Yes, God hears every prayer we make when we come to Him in Jesus' name even the self-centered ones and the ones that are outside His will. The psalmist declared, "O you who hear prayer, to you all men will come" (Psalm 65:2).
But that doesn't mean He always answers those kinds of prayers and we ought to be thankful for that! How many times have you prayed for something selfish, and only later realized how good it was that you didn't get it? You see, God loves us, and He knows what is best for us. That's why He sometimes answers our prayers with a "No" and when He does, it is because He loves us too much to give us everything we want.
How can you avoid selfish prayers? First, remember that it isn't always wrong to pray for ourselves. God wants us to bring our needs to Him, and to rely on Him and not just ourselves. The Bible says, "Do not be anxious about anything, but in everything, by prayer and petition, with thanksgiving, present your requests to God" (Philippians 4:6).
Then include praise and thanksgiving as a regular part of your prayers. In other words, focus on God in your prayers, and not just on yourself. Do you thank Him for His love, and do you praise Him for His glory? Do you thank Him also for all the good things He gives you? The Bible says, "Enter his gates with thanksgiving and his courts with praise" (Psalm 100:4).