I think everything happens for a reason.
Whenever I think about something bad happening to me, or someone else, I just say that it will be ok because now something good has to happen now. I guess that is a pretty optimistic-dreamy way of looking at things, but it gets me through the day.