1. Apologize. Say you are sorry.
-- I am sorry.
2. No matter how much you want to add something, don't, except to add something that shows you understand what you are apologizing for.
-- I am sorry that I have been rude, and thoughtless. I am sorry that I have put so much anger and negative feelings into my words and actions.
3. Do not, unless asked directly, explain or try to justify. That only makes it look like you're trying to shift the blame or are insincere.
4. If it is appropriate (and how do you know when it's appropriate? good question - practice observing and listening) state what you will do differently.
-- I will try to take more time off when I need it, rather than pushing myself into a state where I do stupid things - I will be more responsible for my own emotional balance. I will try to keep separate that which ought to be kept separate and not make my problems other peoples' problems.
New Year is past, and it is now the time when Jews ask forgiveness. If I have offended or done you harm, I am sorry. If you want to tell me about it so I can more properly apologize I would welcome that.