How to write ERROR and CONFIRM?

For many years when you needed to write any confirm message or an error message in a code there was nothing complicated. However in Business Central there were introduced new functions for both of those messages. One was already there for some time but the error…