In a discouraged, depressed, or dejected manner; without courage or confidence.
From disheartened (past participle of dishearten) + -ly (adverbial suffix from Old English -lice). The adverb form allows the emotional state to modify verbs and other actions.
The fact that English needed an adverbial form shows how common the feeling is—we don't just describe discouraged people, we describe discouraged ways of doing things, suggesting despair affects our very actions, not just our emotions.
Complete word intelligence in one call. Free tier — 50 lookups/day.