Take the wind out of one’s sails

To become discouraged and lose one’s enthusiasm.

It took the wind out of my sails when I was told that I was not doing a good job.