You ask and do not receive, because you ask wrongly, to spend it on your passions. (ESV)
There are people who reject God because they asked him for something and they did not receive what they asked. They wrongly assume that God does not love them because he did not answer them. James gives a different perspective. He says that "you ask and do not receive, because you ask wrongly. What makes it a wrong request? Because the request is selfish.
God does not just give us whatever we ask for. Why? Because he is a much better father than an earthly father. Can you imagine if a father only ever said yes to every request their child had. Would that be good for a child? Children who receive everything they ask for grow up to be selfish monsters. Our parents said no to many of our requests because they loved us enough to say no.
The reality that God does not answer selfish requests helps us to understand the importance of what we are motivated by. If we are truly God's children we should be motivated by glorifying God. A true Christian is not coming to the Lord begging for material possessions that will satisfy worldly desires. Rather, a true Christian asks that the Lord will give them more of what will help them to glorify God.
If you want to hear God answer your requests, begin to ask for the things that he wants to give you. Ask God for more boldness so that you can share your faith with more people. He will answer that request. Ask the Lord for a greater heart of compassion for the poor and downtrodden. He will provide. Say to the Lord, please help me to forgive others. You will receive.
God is not anxious to withhold things from you for no reason. He responds to requests that glorify Him, not begging that is based on your greed.