The Noble Scholar Sh. Sulaymān Ar-Ruhaylī حفظه الله said:
“When a Muslim stays away from the Harām intentionally (seeking the pleasure of Allāh), this is a righteous action. A good deed is written for him and a bad deed is wiped away.”
[Sharh Sahīh At-Targhīb wa At-Tarhīb #28]