Playing it right, but seeing it end so wrong

When it comes to feeling vulnerable, I seem to be in a class by myself.  I'm actually getting really sick of it, and after what happened late yesterday, it's also making me feel really angry.
I felt I couldn't have worked yesterday any better than I did.  I stayed busy, got a good chunk of outside tasks done, and even managed to squeeze an hour's worth of studying in.  Great  day, right?
That's what it should have been.  Instead I'll probably remember it for all the wrong reasons after breaking down in tears -- twice -- during the evening.  The full story is not something I'm comfortable disclosing here...although I did put up a short version of the story on the depression boards.  Basically it had to do with music and bad memories that just combined to give my heart a one-two punch that wired me up enough to ruin my night's sleep...all of it.  It's not the first time that combination has hurt me...but I still have no clue how to deal with that.
This one's especially depressing because it came on the night before this morning's field trip in my legal ethics class to the state ethics commission...which means I get to go in with my attention span cut by half...maybe more.
This is ridiculous beyond words.  My head has a knack for doing this to me almost every time something major is coming up, and it has to stop.