You want to start your email with a clear subject line, which is a quick summary of what the email is about and helps to give an idea on the urgency of the email. Then move to the greeting; I find that “Good morning/ afternoon/ evening” is a good balance between formal and friendly. You don’t want your email to be too long though - keep it short and snappy, no one wants to have to sift through paragraphs just for the overall message to be “can you mark this?”
An obvious one is to use polite language, no abbreviations or swear words and avoid using emojis. If you’re worried it comes across as too harsh there’s no shame in stepping away for a minute and coming back to it after an hour or just getting a friend or flatmate to read over it. The closing statement is nearly just as important as the opening one; a versatile and handy one is “thank you” but I find that it runs a bit short and robotic. Instead I go with something along the lines of: “Thank you for your time/ consideration”.
Emails are a learning curve at university but eventually it becomes second nature to have this formal-informal balance down - even if it does take time. The best thing to do is keep calm, re-read it a couple of times before sending and then send it off and pray it isn’t awkward.