We should treat ourselves with loving kindness. This means: treating ourselves just as a loving parent would treat their child: with love, warmth, compassion, understanding, patience, and forgiveness. A good parent helps their child improve his behavior not through anger, harsh criticism, or accusations but by understanding that the child is learning, by listening to his feelings and showing empathy, and by lovingly giving encouragement, guidance, and advice where appropriate. This is also how we should talk to ourselves.
Kindness also means taking good care of ourselves. Eating healthy foods and avoiding unhealthy ones, exercising, getting enough sleep and rest, and not neglecting physical ailments (going to the doctor when needed). Cultivating good habits that support physical and mental health.
A person who has not been treating himself in this way, and who now understands the terrible harm he inflicted on himself and wants to change his ways for the better, may find it difficult to do at first. This is because he is used to the harsh way, and is still not used to the loving way, or perhaps does not even know how to do it. This requires patience and a will to learn and change. Part of it would be spending some time healing the emotional wounds of the past that he has caused himself as well as the wounds caused to him by others.