If someone used talk to na mahrams in university and work and that talk involved laughing and teasing each other. It was not a romatic talk but casual talking and joking. Now that person is ashamed and wants to repent. What should he do so that God accepts his repentance?

Say astaghfurallah and not do it again. Repentance is about feeling guilt and not doing the same act again