to lose heart: to let hardship or the absence of visible results wear a person's resolve down until they quit something good.
This verb is built on the ordinary Greek word for "bad," and the picture behind it is of someone going bad in the sense of going slack. It never describes a body giving out. It describes the will giving out, so that a person stops doing something worth doing. That is why English versions reach for phrases rather than a single word: "lose heart," "grow weary," "give up."
Every one of the six New Testament occurrences is negative. Nobody in the New Testament ever does this; the word only ever names what a writer refuses or forbids. Paul says twice over that he and his coworkers do not do it, even while the body is wearing out and the sufferings pile up, and he asks the Ephesians not to do it on his account. Jesus tells a parable so that people will keep praying and not do it. Twice the warning attaches to steady, unglamorous good work that shows no return yet.
The two settings shade the word differently. Under affliction it is closest to despondency, the sag that comes when the cost of the work is plain and the reward is not. Attached to a practice like prayer or doing good, it is closer to simply quitting, the point at which a person decides the effort is not worth continuing. Both are the same failure: the strain outlasts the resolve.
Greek has neighbors for this that are worth keeping apart. In Galatians 6:9 this word stands beside ἐκλύω, which pictures strength coming untied, and which can describe real physical collapse from hunger. κάμνω is closer to plain tiredness, and κοπιάω is working oneself to exhaustion, which the New Testament treats as honorable and never forbids. The positive counterpart is ὑπομένω, staying under a weight without shifting out from under it.