Happy is one … who is ardently devoted to God’s commandments. (112:1)
There are no guarantees of happiness in this world. Making the most money or acquiring the best ‘toys’ won’t do it, but studies have shown that those who spend time serving others tend to be happier than those who live self-centered lives.
God has many commandments and they have a variety of functions, although the Torah generally does not describe a purpose for the commandments. Living a life of participation in public prayer, Sabbath and holiday observance (including the communal aspects of such holy days), tzedakah and service towards others tends to creates the conditions for greater happiness. However, it is not an automatic response, like dropping a quarter into a parking meter. Showing up for a minyan now and then when you feel like it does not show devotion. Showing up consistently, even when you are tired and would rather be doing something else, does. Being physically present because you were asked to make a minyan but mentally zoning out, or rushing through your prayers and leaving the service early so your can get to your next activity doesn’t show devotion. The former is minimally doing someone a favor and the latter is selfishness – devotion to your prayer, not devotion to being a part of a community serving God.
Devotion to God’s commandments requires a high degree of selflessness. I have to be willing to give something up for God and it is precisely in setting aside my ego and my needs in favor of something else that satisfaction and happiness may be found.