Once again let's take a close look at the words in that text, keeping in mind that all those addressed would be within one local assembly of believers, and know (or know of) the people within their church.
1. John is addressing believers (Christians) throughout this epistle. Therefore
"if anyone" can also be understood as
"if any Christian".
2.
"His brother" is the key. Since all genuine believers are children of God, they are all within one family as brothers and sisters. So "his brother" means
"another Christian". And "brother" there is simply generic, since John was fully aware that there are both brothers and sisters. That is similar to most documents using the generic "he" rather than he/she".
3.
"A sin not leading to death" confirms that Christians can and do sin, and John makes this perfectly clear right at the beginning of the epistle --
If we say that we have no sin, we deceive ourselves, and the truth is not in us... If we say that we have not sinned, we make him a liar, and his word is not in us.
4.
So the basic principle here is that we are to pray for Christian brothers and sisters who may have sinned, so that they will deal with their sins and turn away from them. It would appear that these are sins known to the whole church. This means addressing our present sins, confessing them to God, and repentance (turning away from sin and evil). The "flesh" (the old Adamic sin nature) is not eradicated when a person is born again, therefore Christians must examine themselves constantly.
5. At the same time, there may be a brother or sister who has sinned, and probably been approached by another Christian or elder about this matter,
but has refused to deal with that sin, and has persisted in sinning. God may even chastise this person and there may be no change. So then the remedy is premature death, since this person is ruining God's testimony.
6. This becomes
"the sin unto death" and John says that there is no point praying for this person, since he has hardened his heart and will die. That is why Paul warns every Christian to examine themselves before partaking of the Lord's Supper:
1 CORINTHIANS 11
26 For as often as ye eat this bread, and drink this cup, ye do shew the Lord's death till he come.
27 Wherefore whosoever shall eat this bread, and drink this cup of the Lord, unworthily, shall be guilty of the body and blood of the Lord.
28 But let a man examine himself, and so let him eat of that bread, and drink of that cup.
29 For he that eateth and drinketh unworthily, eateth and drinketh damnation [CONDEMNATION] to himself, not discerning the Lord's body.
30 For this cause many are weak and sickly among you, and many sleep. [AND MANY DIE PREMATURELY]