Try apologizing without finding any excuses
We are humans, we are not perfect, we all mess up at one point, some more, some less, but we all make mistakes, we all have problems, it's normal.
Usually, if it's work related, we tend to apologize finding excuses. I don't say it's lying. No! I know those excuses are true and because of those reasons you really couldn't do the job in time or did something wrong. The point is, when you tell your boss, try to avoid the excuse, the reason and take responsibility. After all, in most cases it's your fault. You got stuck in traffic -> others fault. Well, sorry, it's not. It's yours. You didn't get up earlier to get in time. Don't blame the traffic jam because since you go to work everyday, I'm sure you already knew that the traffic is horrifying.
I messed things up lately and I was thinking it's because the last two weeks of the semester are always full. Projects, homework and other stuff like that and everything has to be done before exams start. Kinda big reason to have a messed up schedule, right? I mean, school is important. But guess what? It's not my school's fault that I organized my tasks badly. It's all on me. I didn't do things right, not my school schedule. If I'd been more careful and proactive, I should have thought about how much time I need for a project instead of thinking I could finish it in one night.
We are the ones who do the mistake. We are the ones who should be blamed. Not anyone else. The hard part is, and I speak from experience, to admit that.
I use to say: "...but I had so many tasks and the teacher wanted us to do that and that....". No one in questioning your reason, but it's still your mistake. You didn't plan your tasks so you could finish on time and be well and done with everything when you were supposed to.
Saying "sorry" without blaming the situation or other people is not comfortable, but we`d better get used to it. It`s about proving that you are mature enough to know you made a mistake, you won`t get hanged for that, trust me. The idea is to learn from our mistakes and don`t repeat it. If it happens more than often, well, there could be consequences like you getting fired for example.
I will try to express my regrets without elaborating the reasons why and trying to get out of the situation, will you do the same?