The whole reason we get discouraged is because we begin feeling sorry for ourselves. It's a normal part of life; Elijah, Moses and David went through seasons of discouragement. However, when we stay discouraged for prolonged periods of time, bad things happen. This is one of Satan's favorite weapons, because he knows that if we continue to wallow in self-pity it will develop into depression, which eventually leads to a defeated Christian life at best, and suicide at worst.
How do we stop from sinking into this easy trap? The answer is found all over the Bible. When did Peter start sinking? When did Elijah ask God to kill him? When did King Saul fall on his own sword? They all took their eyes off of the Lord, and consequently, lost all hope. Everything was fine when they were in touch with God and understood that God had everything under control. It was when they stopped looking straight up and started looking around them that everything fell apart.
Turn your eyes upon Jesus,
Look full in His wonderful face,
And the things of earth will grow strangely dim
In the light of His glory and grace.
Discouragement is easy to fall into because we're selfish and would really like it if the world actually did revolve around us. However, God designed us to rely on Him, not on ourselves, to get through tough times. There is only one way to survive the death of a loved one, a rough summer, a move, or a dissapointing experience without getting bitter at God: stop focusing on your misery and start focusing on how faithful God has always been to you. He will never leave you, nor forsake you.