Regret is the 1st condition. But it is not enough. You have to quit the sin. You have to stop the mistake. Tawbah (repentance) is linguistically to come back. We must quit what we are doing and come back to Allah, come back to his guidance, and come back to his straight path.
The Prophet once drew a straight line and drew diagonal lines besides it and he said, “that is the straight path and these are the paths, in the beginning of each is a devil calling people to it.” He then recited a verse from Surah al-An3am, “Verily that is my path; it is straight thus follow it and follow not the paths for they take you away from His path …”
Imagine you are traveling from one place to another and you took the wrong exit. You know that you took the wrong exit and you regret taking it. You know how to come back and you know that you must come back. Nevertheless, you continue deviating from your main path until you lose your destination completely. Let us not just regret, let us come back!