In James 4:3 it says: "You ask and do not receive, because you ask wrongly, to spend it on your passions." In essence, what is being conveyed is that not all prayers are pleasing to God; rather than seeking to honor God and His Kingdom purposes. Such prayers seek only to gratify self-centered passions, just a desire to pursue personal happiness. Some silly and downright selfish things are often done in the name of pursuing happiness. Many a marriage counselor and pastor will attest to hearing something along these lines, "I'm not happy in this marriage: God wants me to be happy; therefore, I want out of this marriage".
This self-centered perspective is mistaking hedonism for happiness. They think that their circumstances are supposed to make them happy. They are pursuing pleasure at the cost of meaning. Don't fall for this lie. Hedonism does not equal happiness. Hedonism, the goal of which is to maximize net pleasure, lacks meaning altogether. Meaning is a vitally important ingredient of true happiness. It is a fact, not just a biblical sentiment that: You will find more happiness in giving yourself away than in any self-centered pleasure. Now, the pursuit of holiness can't help but bring an ongoing happiness and joy. Why? Because holiness, being devoted to God's ways of being, incorporates meaning and love. True happiness is never fulfilled without it. When we sow holiness, we reap happiness and long standing joy.