Our taxi driver on a trip round the island in Barbados was called William. He said William is a good name for a husband, because you always have bills. He said there are people in the world who don't want to be happy. He will have their happiness if they don't want it.
Something unexpected happened to him: one of the passengers on the trip was visually impaired, and required a lot of assistance (although actually the man was pretty independent to have come on the trip on his own in the first place). William said that all difficulties thrown in his path are a test and an opportunity to see how well he will deal with things.
This last idea is the one I like best. If we live in a heartless mechanical universe, then anything that happens outside our expectations is annoying and makes us grumpy and negative. It puts us in a small dark place in our minds. If on the other hand there is some purpose to it all, then we can place ourselves in the hands of that higher power, do our best and be happy.
What if it is all meaningless? Someone once said that the Greeks dreamed the right dream. Since, one way or another, we dream our way through our lives, it is good to dream a dream that works ('a path with heart' as Carlos Castaneda put it). To keep our minds open and in the light. To take challenges with a good attitude. Better still, to dream well and know that we are dreaming.
Attributed to Meher Baba: "Don't worry, be happy, make efforts."
(Note: I have not found the source of this quotation despite an internet search.)