Which is why the usual advice misses
If loneliness were the count, the fix would be arithmetic. See more people. Join something. Say yes more often.
Plenty of lonely people have done exactly that and come home from a room of forty people feeling worse than when they left. That is not a failure of effort and it is not proof that something is uniquely wrong with them. It is what happens when you treat a gap as if it were a shortage.
So the first useful thing is not a plan. It is knowing which of the two you actually have, because the gap and the shortage are not repaired by the same thing.