In this Psalm the writer is in great distress. His life is miserable. He is in physical pain, and his friends have abandoned him.
So, he prays to God for help from his situation. In the beginning of his prayer he says to God, “Let my prayer come before Thee.” To me this implies that God does not hear all prayers. Nor does He answer all prayers favorably.
This leads to the following question. Which prayers will God hear and answer? The Bible says, “The prayer of a righteous man avails much.” Therefore, I conclude that God will hear and answer the prayers of those who live rightly before Him. He will hear the prayers of those who love God and demonstrate that love by the lives they lead.
Those who live their lives according to the Word of God are demonstrating love for God. They trust God and obey His guidance.
Those who do not love God live contrary to the Word of God. Sometimes these people may be in pain and distress, and they pray for God’s help. God may not hear their prayers.
Therefore, if we want our prayers to be heard we must live our lives according to the Word of God, the Bible.