How to repent in Islam: Seeking forgiveness from Allah and repenting in a way that attracts His mercy is not about reciting certain words or dua in a language you don't even understand because the main objective of doing astaghfar is to acknowledge our mistakes and wrongdoing and then expecting Allah to forgive us as He is the most merciful.
So, your astaghfar will consist of these steps:
1) Admit your mistake. Don't even try to defend yourself
Your ego is your enemy and it does not want you you change. Your ego (nafs) will come up with a million excuses and reasons why it was not your fault and how good you are. No. Just admit your mistake as it will set you free.
When you sit down to do your astaghfar, focus on telling Allah that you accept your wrongdoing and mistake and you are really sorry. This step is vital to free you from the traps of your own nafs/ego and shaitan.
Note: Don't even try to defend yourself as your nafs loves to take control and will keep giving you reasons to believe that you are a good soul and will try to blame the situation, other people, circumstances and even shaitan.
2) Believe that Allah has forgiven you already. Don't doubt His mercy at all.
Your forgiveness from Allah will depend on how much belief or trust you have in the Most Merciful. Many times, we make astaghfar with a doubtful mind, wondering whether Allah will forgive us or not. This is against the teachings of Quran and we should keep in mind that Allah loves those who put their complete trust in Him. So, throw away the doubts and negative thoughts about Allah and His mercy.
3) Start giving thanks to Allah for giving you a chance to make astaghfar
This step is the most important and most powerful and you should not take it lightly. Allah loves his praise and appreciation. Thank Allah for giving you an opportunity to correct your mistakes and sins. What would happen if Allah never even let you turn to Him for astaghfar? Would you be able to do astaghfar then? Allah could have punished you right after making the sin, but look what He did? He did not punish and does not punish as He waits for us to think about our conduct and mistakes. This is His mercy. So start giving thanks intensely. You will be surprised to know how much Allah loves thankfulness and gratitude.