Bismillah al-Rahmaan al-Raheem
What is necessary in this case is to repent to Allah and seek His forgiveness. True repentance means to acknowledge one's mistake, feel remorse for it, and make a firm decision not to repeat it again.We should never forget that Allah forgives all sins, however big they are, and has commanded us never to lose hope in Him:
قُلْ يَا عِبَادِيَ الَّذِينَ أَسْرَفُواعَلَىٰ أَنفُسِهِمْ لَا تَقْنَطُوا مِن رَّحْمَةِ اللَّـهِ ۚ إِنَّ اللَّـهَ يَغْفِرُالذُّنُوبَ جَمِيعًا ۚ إِنَّهُ هُوَ الْغَفُورُ الرَّحِيمُ
Say [that Allah declares,] ‘O My servants who have committed excesses against their own souls, do not despair of the mercy of Allah. Indeed Allah will forgive all sins. Indeed, He is the All-forgiving, the All-merciful. (39:53)
May Allah forgive all of our sins and give us the tawfiq to obey Him in all that He has made waajib on us, and avoid all that He has made haraam on us.