Dashes are informal punctuation
When writing a formal letter or other kind of document, some punctuation symbols are best avoided because of their informality. Dashes are one example, exclamation marks are another. To avoid them, replace with a more formal punctuation alternative.
In the example in the image, a comma or even a colon could replace the dash.
Max was accompanied by his mother, Sofia.
A colon is also a better option than dashes when writing a list of items. It’s also possible to reorder the planned sentence. Or you can do both e.g.
Mr Erikson’s current medication – warfarin and Pulmicort – need review at his next consultation.
At his next consultation, Mr Erikson needs a review of his current medication: warfarin and Pulmicort.
Remember, dashes are different to hyphens. A dash – is longer than a hyphen -. Hyphens are used in compound nouns such as ice-cream or to show the link between multi-word phrases e.g. 21-years-old. Hyphens are appropriate in formal writing.