Just go up and talk to him. Explain (if you want text..) why you were ignoring him, what was wrong, etc. If you were ignoring him for no reason...make something up..?
Being sorry about something you did is like saying sorry for tripping you and if your sorry for something that happened is like sorry for your loss.Sorry for your mistakes.Sorry about your loss.