In John 9. The blind man was reasoning with the Pharisee about his healer being of God or not and said:
…any man be a worshipper of God, and doeth his will, him he heareth.
If he worships God and does God’s will..Than God hears him
But just because God hears a human does not mean the person is going to get what he prayed for.
According to the book of James God doesn’t give things
If the reason you want it is wrong.
Ye ask, and receive not, because ye ask amiss, that ye may consume it upon your lusts.
Another thing a person needs to do is to have faith without doubting
6.But let him ask in faith, nothing wavering. For he that wavereth is like a wave of the sea driven with the wind and tossed.
7 For let not that man think that he shall receive any thing of the Lord.
8 A double minded man is unstable in all his ways.
So to get God to answer your prayer you will have to
1. Worship God
2. Do His will
3. Make sure you want it for the right reasons
4. Have faith and don’t doubt at all