Like so many others, I don't think it's to do with what life has dealt you, but it's to do with the way you perceive that. What I don't know is if that comes from your personality or your upbringing, your faith, or what.
We've had probably more than our "fair share" of difficulties, but overall, I've always been able to 'look on the bright side' / find the silver lining / or whatever other phrase you want to trot out.
I stick to the 'when life gives you melons, make lemonade' way of thinking. There's always someone worse off that yourself, which is strangely comforting in a way that's odd, as it's not a very kind or generous thought.
If you start dwelling on the negative things, then I think life becomes a bit of a downward spiral, and you then become more 'down' , and it's harder to get out, or you find yourself with fewer friends, and so life feels worse, and so on and so forth.