John is speaking of the confidence we have in prayer in 1 John 5:14-15. Building on the theme of assurance that runs throughout the letter (note all the places where the word “know” is used), he wants us to understand that when we ask anything according to His will, it will be granted! God isn’t playing word games with us (“Ask for what I was already planning to give to you and I’ll ‘answer’ those prayers”). There is substantial truth here for the disciple that John wants us to have. I’ve dealt with this here if you’re interested in pursuing it.
Having provided them with this overall assurance, he moves on to intercessory prayer and a specific issue that had arisen from the Gnostic influence about something he had initially dealt with in 1:8-10. There John declared that the Gnostic belief that they were incapable of sinning (i.e., their spirit wasn’t responsible for the evil deeds of the body and therefore they were sinless), was self-deception, the truth was not in them, and they made God out to be a liar. Now in 5:16-17, John deals with how that impacts their prayer for each other.
He presents two situations. The first concerns a brother or sister who commits “a sin that does not lead to death” (v. 16). I think this goes back to 1:7 and 2:1, where he speaks of disciples sinning even though they are committed to living righteously and walking in the light. Every believer is experientially familiar with this painful truth. From Peter who boasted that he wouldn’t deny the Christ and later did to whatever areas we stumble in, we recognize we’re not just people who have sinned once or twice—were sinners (see Luke 18:13). Forgiven sinners, but sinners, nonetheless.

But were not alone. We’re part of a caring Christian community that is called upon to enter into the struggle with sin that any of its members are experiencing (2 Corinthians 11:28-29; Galatians 6:1-2). John lets us know here that prayer is part of that care package. We are to pray for our brothers and sisters who “commit a sin that does not lead to death” (1 John 5:16). In the context of 1 John, that’s any sin that is committed by a disciple who lives in penitence and seeks to please their Lord. We’re to pray “and God will give them life.”
I think this is not only suggestive of forgiveness, but of overcoming (2:13-14, 4:4, 5:4-5). After all, Jesus didn’t come only to forgive our sins, but to give us life (John 10:10). Having our sins forgiven is part of the life He came to bring, but there is much more beyond that (i.e., walking in the light, loving one another, etc.). There is a real need for us to engage in rich, deep, prayers for each other that ask God to help us experience this life (read the prayers at the beginning of most of the N.T. letters).
Moving on to the second situation John addresses, it concerns the person who has become entangled in the false teachings of Gnosticism and believes they are incapable of sin. Can that person receive forgiveness? Only if they acknowledge their sin (1:8-10).
But that’s exactly the problem, isn’t it?

Now you see why John tells the disciples what he does. As long as someone is in denial about the possibility of sin in their life, they have cut themselves off from from forgiveness and life Christ offers us. In the context of 1 John then, the sin that leads to death then isn’t any particular sin, it’s the arrogant attitude that believes sin is an impossibility for them.
This connects with the larger principle found throughout Scripture—the exalted will be humbled and the humble will be exalted. David summed it up when he wrote:
You do not delight in sacrifice, or I would bring it;
Psalm 51:16-17
you do not take pleasure in burnt offerings.
My sacrifice, O God, is a broken spirit;
a broken and contrite heart
you, God, will not despise.
The longstanding absence of this spirit in Jeremiah’s time is what prompted God to forbid the prophet from praying for the people (Jeremiah 7:16, 11:14, 14:11-12). Jesus made it clear that the kingdom of God is promised to “the poor in spirit” and no one else! All this should help us understand that repentance is less what we do and more a state in which we are called to live. No disciple is aware of all of their sins, but we do know we are sinners and can live with a corresponding humility.
There is a right way to deal with sin that leads to assurance and a wrong way that leads to death. We need to know the difference and pray accordingly!