The prefix "dis-" means "the opposite of" or "to remove," and the suffix "-en" is used to form verbs.
Therefore, "dishearten" means "to make someone lose courage or hope," which is the opposite of feeling encouraged or hopeful, thus referencing the "heart".