You can't. It's just not like human beings to be totally happy, and anyone who really is totally happy would be locked up in an asylum. But you could probably be happier than you are now if you really wanted.
The secret (well, one secret) is in understanding that you can have just about anything you want, but you can't have EVERYTHING you want. You have to make decisions and, having made them, to realize that these decisions have 'opportunity costs'. You give up something to get something. You give up a LOT of things, sometimes, to get ONE thing you really want. So you can't whine about not having the things you decided against. It's all about choices.
Another old saying with some truth to it (I think) is that often we must forego pleasure to find happiness. Happiness doesn't mean living just for the moment, ignoring possible consequences, etc. Sybarites, hedonists, libertines etc. are not happy, just as alcoholics and drug addicts are not happy. A certain amount of self-discipline is important to real happiness. Happiness is a long-term goal.
And finally, you can't be happy unless you WANT to be happy! A lot of people really don't want to be happy! They are the ones always complaining about stuff, dumb stuff that can't be helped. Some people are just like that, I'm sure you've noticed this yourself. If you really want to be happy, you'll learn to deal with stuff that you can't change. You'll learn not to let it bother you.