A good apology over text is short, specific, and free of excuses. Long messages full of justifications read as defending yourself, not owning the mistake.
Name what you did, acknowledge how it affected them, and say what you will do differently. Then give them space to respond.
Skip the but and the long backstory. A clean I was wrong and I am sorry lands far better than a defense.
Show you understand why it hurt. Feeling heard matters more to most people than a perfect explanation.
A brief note on what you will do differently turns sorry from a word into a commitment.
For smaller things, yes. Text gives the person space to process. For serious issues, a text can open the door, but a call or in person often means more.
Name what you did, acknowledge the impact, and say what will change. Cut the but and the long justifications, which read as self-defense.
Give them space. A sincere apology does not demand instant forgiveness. Do not bombard them. Let them come back when they are ready.