Teach your children how to build friendships. For example, suggest they listen to others speak without interrupting and be understanding and compassionate.
Make them laugh and smile. Then, listen to them when they tell you they are hurt or insulted.
If your actions hurt others, they will not want to be with you, let alone be your friend. Accept their feelings and attempt to find out what was said that made them feel the way they do. Then, correct your approach if you want a sincere relationship with them. Introduce them to books with characters from different walks of life, and model building friendships with openness and inclusiveness. And, stress that kindness is a virtue.