If you don't feel sorry for what you did, then don't apologise. If you do feel the need, then read on.
There are three kinds of apology.
The first group is those for minor social infractions, like bumping into someone, etc.
Another is in a kind of "legal" sense where you just have to say the words - where one can even get someone else write it for you, and you sign without really feeling sorry at all.
The third follows a much more human emotional realisation of "oh my god, what have I done" and a contrite need to express one's remorse.
The first can be as fake as you like, provided it ticks the boxes. It's not a real apology - it just "gets them off your back".
The second utterly depends on being very clearly aware of the extent of wrong one has done. The person making the apology has to go out of their way to make sure that their sincerity shines through. It includes an acknowledgement of what they did, and expresses their feelings of dismay at their actions, and of contrition. It should be non-confrontational, and should offer no excuses.
In both cases, words to the effect of "I was unkind/wrong/etc., sorry about that" is almost always inadequate.
I also believe that sincere contrition should be spoken. Doing it by no more than a brief text is at best a brush-off, and at worst rather cowardly.
The best "how to apologise" that I have seen was by my former boss.
If his organisation had wronged someone, he sent a member of the Executive and the manager of that department to the person's house, to apologise in person, as well as handing over a letter of apology, flowers, and sometimes chocolates as well.
My mother used to say that you can't say "thank you" too many times, and you can't say "I'm sorry" too many times.