“The righteous cry out, and the LORD hears, and delivers them out of all their troubles. The LORD is near to those who have a broken heart, and saves such as have a contrite (crushed) spirit. Many are the afflictions of the righteous, but the LORD delivers him out of them all.” (vv.17-19)
Here in the latter part of Psalm 34, David expresses the truth that the righteous will have troubles, problems. He does not say that God will spare them from broken-hearts, but rather He will hear them, be near to them, deliver them, and even rescue them from a crushed spirit. This is the truth for every believer.
However it becomes very easy to get discouraged while going through our troubles. Discouragement is a real feeling, and is a tool used by the enemy against every child of God at one time or another. This feeling must be fought off by prayer, scripture, and support from the body of Christ. If you let it sink in, discouragement will press you down, and it can hinder you from doing what the Lord has called you to do.
Therefore, if you are discouraged, take your situation to God in prayer. Look into His Word and claim His promises upon your life, and seek the support of other brothers/sisters in Christ, and He will lift you up.
The Truth: “For thus says the High and Lofty One that inhabits eternity, whose name is Holy; I dwell in the high and holy place, with him who has a contrite and humble spirit, to revive the spirit of the humble, and to revive the heart of the contrite ones" (crushed in spirit). Isaiah 57:15