This is a story of Ibrahim ibn Adham (radiAllahu anhu) giving advice against disobedience.
A man came to Ibrahim ibn Adham (radiAllahu anhu) and said, "Abu Ishaq, I am unable to control myself. Please give me something to help me with it"
"If you accept five conditions," said Ibrahim, "and are able to put them into practice, your disobedience will not cause you any problem."
"Just tell me what they are, Abu Ishaq!" the disobedient man said.
"The first is that when you want to disobey Allah you do not eat anything He provides."
"Then how will I get anything to eat? Everything on the earth is from Him!", said the disobedient man.
"So is it right to eat what Allah provides you with and then disobey Him at the same time?" replied Ibrahim.
"No, it is not", said the disobedient man. "What is the second condition?"
"When you want to disobey him, move off His land."
"That is even more difficult!", exclaimed the man. "In that case where will I live?"
"Is it right to eat his provision and live on His land and then to disobey Him?" asked Ibrahim.
"No, it is not", replied the man. "What is the third condition?"
"When you want to disobey Allah, in spite of eating His provision and living on His land, find a place where He will not see you and disobey Him there."
"What do you mean, Ibrahim? He knows everything that happens even in the most hidden places!", said the disobedient man.
"So is it right to disobey Him when you eat His provision and live on His land and when you know that He can see everything you do?", questioned Ibrahim.
"It certainly is not!" the man replied.
"Tell me the fourth condition.", the man asked.
"That when the Angel of Death arrives to take your soul, you say to him, 'Give me a reprieve (give me more time to live), so that I can repent and act righteously for Allah.'"
"But he won't listen to me!"
"Then if you cannot ward off death long enough to give yourself time to repent, and you know that when it comes there will be no reprieve, how can you hope to be saved?", replief Ibrahim.
"What is the fifth?", asked the man.
"That when the angels of the Fire come to you to take you to the Fire, you do not go with them," said Ibrahim. "But they will take me whether I like it or not!", exclaimed the man.
"So how can you hope to be saved?"
"Enough, enough, Ibrahim! I ask Allah's forgiveness and I turn to Him!"
The man's repentance was sincere, and from that time on he was assiduous in his worship and became a good Muslim, avoiding acts of disobedience until the day he died.