Dear [Name],
I am writing to apologize for my inattention during our recent [meeting/discussion/etc.]. I understand that my lack of focus was disruptive and I regret that I did not give you the attention you deserved.
I am aware that my behavior was unprofessional and I apologize for any inconvenience it may have caused. I understand that my actions were inappropriate and I take full responsibility for my actions.
I want to assure you that this was an isolated incident and I am committed to being more attentive in the future. I understand the importance of being present and focused during meetings and discussions, and I will strive to be more mindful of my behavior in the future.
I understand that my actions have caused you to question my commitment to our [project/team/etc.], and I want to assure you that I am still deeply committed to our work. I am dedicated to doing my best to ensure that our [project/team/etc.] is successful.
Again, I apologize for my inattention and I will strive to be more mindful of my behavior in the future.
Sincerely,
[Your Name]