Sure Al-Maaida

5:93

لَيْسَ عَلَى ٱلَّذِينَ ءَامَنُوا۟ وَعَمِلُوا۟ ٱلصَّٰلِحَٰتِ جُنَاحٌۭ فِيمَا طَعِمُوٓا۟ إِذَا مَا ٱتَّقَوا۟ وَّءَامَنُوا۟ وَعَمِلُوا۟ ٱلصَّٰلِحَٰتِ ثُمَّ ٱتَّقَوا۟ وَّءَامَنُوا۟ ثُمَّ ٱتَّقَوا۟ وَّأَحْسَنُوا۟ ۗ وَٱللَّهُ يُحِبُّ ٱلْمُحْسِنِينَ

Es lastet keine Sünde auf denjenigen, die glauben und rechtschaffene Werke tun, hinsichtlich dessen, was sie (bisher) verzehrt haben, wenn sie (fortan) gottesfürchtig sind und glauben und rechtschaffene Werke tun und wiederum gottesfürchtig sind und glauben und wiederum gottesfürchtig sind und Gutes tun. Allah liebt die Gutes Tuenden.

Tafsir 5:93

There is no sin on those who have faith in Allah, and do good actions to gain closeness to Him, for drinking alcohol before it was made unlawful, as long as they now stay away from it, being mindful of Allah’s anger, having faith in Him and doing good actions, and then increase in their awareness of Allah until they worship Him as if they see Him. Allah loves those who worship Him as if they see Him, because they are aware that Allah is always watching them. This leads believers to improve their actions.