Formal:
* Je suis sincèrement désolé(e) de ne pas vous avoir répondu plus tôt. (I am sincerely sorry for not having replied sooner.)
* Veuillez m’excuser de mon retard à vous répondre. (Please excuse my delay in responding to you.)
Informal:
* Désolé(e) de ne pas t’avoir répondu avant. (Sorry for not replying sooner.)
* Je suis vraiment désolé(e) de ne pas avoir répondu plus vite. (I am really sorry for not replying faster.)
More specific:
* Je suis désolé(e) pour le retard dans ma réponse, j’étais très occupé(e). (Sorry for the delay in my response, I was very busy.)
* J’ai oublié de te répondre, j’en suis vraiment désolé(e). (I forgot to reply to you, I’m really sorry.)
You can choose the phrase that best suits the situation and your relationship with the person you are writing to.