What you're looking for is therapy. It takes a long time. There are little things you can do, but generally motivation and happiness are deeply rooted in things like your personality, income level, and a myriad of external factors that can't just be "hacked".
You can, however, do the following, which are known to be done by happy people (causal relationship is not necessarily established):
1. Exercise daily
2. Eat food in moderation, and mostly healthy food
3. Maintain close relationships with friends and family (loneliness is very bad for your health)
4. Write down 5 things you're thankful for every day
5. Meditate, practice mindfulness, or otherwise clear and focus your mind for a non-trivial amount of time every day
6. Similar to #5: take time to be bored