When you feel lonely, maybe you do not need other people to accompany you. You just have to be at peace with yourself, forgive the mistakes you once made.
If you can accept and love yourself more, you can live more calmly. The pain of loneliness that hit can be gradually recovered.