How to cope with the depression resulting from the gaps between reality and ideal?

We all have ideals, practical or somewhat impractical.Of course,these so-called"impractical ideals" will face lots of barriers when we move forward,as they are a little bit ahead of the reality.What's worse,these barriers make us down and less motivated.As a result, we will sink into depression. I'm afflicted by these depressions,could anyone offer some advice drawn out from their own personal experiments?