In The Name of Allaah, The Most Merciful, The Bestower of Mercy.
Imaam Abdul Ghaniy Al-Maqdisi stated in his book At-tawwaabeen that a man once came to Ibraaheem Bin Adham and said, “O Abu Ishaaq! Indeed I have transgressed against my Nafs [through evil deeds], so present to me that which will be a deterrent for my nafs and will save [or rescue] my heart”. So, Ibraaheem said to him: “If you accept five affairs and fulfil them, neither will you be harmed due to sinning nor will the enjoyment [or delight from it] bring you destruction. The man said, “Mention them to me O Abu Ishaaq”.
Ibraaheem said: “The first affair is that when you want to disobey Allaah – The Mighty and Majestic- do not eat His provision”. The man said, “Where would I eat from when it is case that all that is in the earth is from His provision?” He said, “O you! Is it right that you eat His provision and disobey him?” The man said, “No; mention the second affair to me”.
Ibraaheem said, “If you want to disobey Allaah, do not live anywhere in Allaah’s earth”. The man said, “This is greater than the first affair! When it is the case that the east, the west and whatever is between them belongs to Him, then where would I live?” Ibraaheem said to him, “O you! Is it right that you eat His provision and live on his earth, yet you disobey him?” The man said, “No; mention the third affair”.
Ibraaheem said, “If you want to disobey Him whilst you are being provided from His provision and living on his earth, then do so in a place where He cannot see you”. The man said, “How can that be when it is the case that He knows everything that is hidden”. Ibraaheem said, “O you! Is it right that you eat his provision, live on his earth and you disobey him whilst he sees you and what you do?” The man said, “No; mention the fourth affair”.
Ibraaheem said, “When the angel of death comes to take your soul, tell him, ‘Delay its departure until I perform sincere repentance and perform righteous deeds for the sake of Allaah’”. The man said, “He (the angel) will not accept that from me”. Ibraaheem said, “O you! When it is the case that you cannot repel death until you repent and you know that there is no delay when it comes to you, then how do you hope to escape?” The man said, “Mention the fifth affair”.
Ibraaheem said to him, “When the Zabaaniyah [i.e. guardians of hell] come to you on yawmul qiyaamah to take you to the fire, do not go with them”. The man said, “Neither will they leave me nor accept that from me”. Ibraaheem said to him, “So, how do you hope for safety then?” The man said, “O Ibraaheem! This is enough! This is enough! I seek Allah’s forgiveness and repent to Him.”
[Source: At-taleeq Alaa Bawaa’thil Khilaas Min Adh-Dhunoob. Lesson 1. By Shaikh Abdur Razzaaq Al-Badr (hafidhahullaah). See here: https://al-badr.net/sub/369]