Since it's not always possible to Prevent errors from happening, when an error does occur be sure to provide clear and specific information to user in plain language (Speak the user's language) to ensure they understand what the error occurred, why it occurred, and how to recover from it.
Jakob Nielsen. “10 Heuristics for User Interface Design: Article by Jakob Nielsen.” Nielsen Norman Group, 24 Apr. 1994, www.nngroup.com/articles/ten-usability-heuristics/. Accessed 1 Mar. 2021.