If someone tells you not to be disheartened, they want you to stay upbeat and positive. Something that brings you down or steals your sense of hope disheartens you.
Uncracking the code of the verb dishearten couldn't be easier. Just take it apart, and it quickly reveals its meaning. Dis- is a prefix that means "not, un-, take away." Heart in its figurative sense means love, care, and good feelings. And the -en at the end shows the word is a verb with the sense of causing something to be. So dishearten means "to cause someone's 'heart' to be taken away." We were disheartened by the news of still more home foreclosures.