You just do it. It's best to talk face to face. Figure out in advance what the offense was and address it clearly and directly. Don't demand forgiveness, but rather focus on your apology. Make it clear that you did not intend to hurt or make fun of him.