By understanding that what you write in an email might come across different than you intend, you need to put a little extra effort into writing it in the first place.
anything you wouldn't feel comfortable saying to someone in person should not be said in an email, text message, or in fact, at all.