When someone shows you their true colors don’t try to repaint them to the tones and hues that you like.
That won’t work.
Don’t try to repaint that person in anyway because that’s not your job and the changes you make in them will be temporary at best, they won’t last.
That doesn’t mean you give up on that person because their true colors aren’t ideal and because they have issues. None of us are ideal, all of us have issues. If you want to have friendships you’ll have to overlook a lot.
If it doesn’t improve, let go. Occasionally it will hurt to let go of some of these people because there are aspects of them that you will truly miss but but you have to weight that hurt against the hurt of holding on to them.
But consider the value of the person as well as their cost in your life.