Elijah was an Old Testament prophet during the reign of King Ahab in Israel. The pinnacle of his prophetic career came on Mt. Carmel, where he had the famous showdown with the 450 prophets of Baal. He won the contest and killed all those idolatrous prophets (1 Kings 18). Jezebel, Ahab’s wife, sent word she was going to kill him, so Elijah fled. After fleeing, he sat down under a Juniper tree asked God to take his life (1 Kings 19:4). He was despondent because he thought he was the only one left who cared about following God (1 Kings 19:10, 14).
Elijah, like many others have, became despondent. He was discouraged to the point of asking: What’s the use? Why bother? The writer of Psalm 119 focuses the seventh stanza on the reality of that sort of despondency.