Note that Jesus said the branch that does not bear fruit is in Him.
We are in Christ Jesus by faith in who He is, what He did and what He expects for us Rom 10:9,10. Those who are InChrist cannot be separated from Him except by rejecting Him Rom 8:35-39.
All fruit comes by the HolySpirit Gal 5:22,23 and we are simply the branch that holds it up
If a branch is dead it is broken off the vine. If a branch is still alive though not producing fruit it is likely because it is not getting sunlight. So, the husbandman takes some string and lifts up the branch so that it can receive sunlight.
It is possible for a branch to be InChrist and yet not produce fruit. This is a result of an untransformed mind. The fix for that is the WordOfTheLord and HolySpirit fellowship.
Purging a branch is removing dead leaves and twigs. This is sanctification by the Word and the HolySpirit Heb 12:1.
Who is the `He` in this passage?
He is the husbandman who is the Father, who is the HolySpirit who is the SpiritOfChrist Jesus.