Create an error Dialog in Blender

i got a problem, i need to let a error dialog to come up when something happens with python

i just found this artikle : but i dont really understand the code, i just need to put an simple error dialog on the screen, this may be the an example :

if …
then let the pop up with this message come up : " … "
else …

If it’s in an operator, use{‘ERROR’}, “Your error message”)

otherwise refrain from creating a popup, it’s against Blender’s UI concept.

You may print to system console if necessary.