How to Write Good Error Messages

Write error messages in clear and simple language. The user should be able to understand the problem while reading an error message. If the error message is ambiguous and the user is not able to find the reason for the message, then it is of no use. Users cannot do anything to fix the problem and it badly impacts the experience of the product.