"And going a little farther He fell on His face and prayed, saying, 'My father, if it be possible, let this cup pass from me; nevertheless, not as I will, but as you will." -Matthew 26:39 (ESV)
Before He went onto the cross, Jesus prayed three different times, "My father, if it be possible, let this cup pass from me; nevertheless, not as I will, but as you will." as we see in Matthew 26:36-44. Jesus, about to be crucified, of course asked God for an alternate route if it were possible. However, there was none, so the answer was no. Sometimes we can get caught up in the power of prayer. Yes the prayer of a righteous man avails much according to James 5:16 (NKJV) and if we knock, then the door will be opened to us (Matthew 7:7-11, & Luke 11:8-13) but sometimes we take this out of context. Sometimes we think that if we pray once for something, we will automatically receive it.
1 Thessalonians 5:17 says "Pray without ceasing". This doesn't mean that we should spend 100% of our time in prayer to God, but that we pray all the time. If someone were to say, "I go to the movies all the time." Would you think that they were at the movies 100% of their time, or that they go to the movies often? The same can be said about this verse. It's not saying that we have to devote all of our time to praying, but that we need to pray continually. Why? Well, have you ever had a friend that never really talked to you except to ask you for a favor? When you asked them to help you with something, they always found a way out of it, but as soon as they needed help, they were automatically your friend? Would you be very willing to help out that person? God is not going to say yes to you if you only ever speak to Him if and when you want something.
Your prayers may seem unanswered when the answer is "no" but God knows much better than we do. Imagine if God had said "yes" to Jesus when He asked to not be crucified? Not because Jesus didn't want to save us but because he was human on this earth, and He of course didn't want to be tortured for several hours until He died. When God doesn't give us the things we ask of Him, it's not because He doesn't love us, but because He does. Also, Matthew 7:7-11 and Luke 11:8-13 are in the context of things that we need. If we genuinely need something, God will supply it. It's just that we don't always need the things that we think we do.
Sometimes, it seems like God isn't hearing our prayers. It seems like He doesn't care. However, this is not the case. It is our job as Christians to serve God earnestly and to pray every day. I would like to encourage you all to pray constantly, and to never let the "no"'s make you feel as if your prayers are unanswered.