It depends on what you did. If you did something that would directly offend him/her, then give it some time (but not too much!) before approaching him/her and giving a sincere apology. Make no excuses. Admit that you did something wrong, and that they were completely right in ignoring you and that you deserved it. If you did something to offend his/her friend and he/she is ignoring you because of that, try your hardest to correcting any problems with their friend and maybe he/she will stop ignoring you.