Answer:
Hey [friend],
Unfortunately, due to a turn of events, I am not able to attend your birthday party, which I had really been looking forward to. I promise you, the reason I couldn't come is actually important. As I had been cleaning out my desk today, I had discovered an essay which, when I look in my agenda book, was supposed to be turned in two days from now. Normally, I would have came still without any hesitation, knowing I had 48 hours left to do it, but after careful consideration, I decided against doing so. The essay required a lot, and I couldn't risk failing from not having enough time, so I truly am sorry about that... Either way, I hope you have an amazing day with your other friends/family! Don't let one less friend ruin your birthday!
My condolences,
[person writing letter]
P.S. Let me know how the party went! :))