The Prophet Muhammad (peace be upon him) told the story of two men, one of whom would commit sin and the other would strive to do his best in the world. When the man who exerted himself in worship continued to see the other in sin, he would say: "Refrain from (sinning)." The sinner replied: "Leave me alone with my Lord. Have you been sent as a watchman over me?"
The man who tried to do his best then said: "I swear by God, God will not forgive you, nor will He admit you to Paradise." When they both died and came before God, He told the man who had striven hard in worship: "Did you have knowledge about Me or had you power over that which I had in My hand?" God then said to the man who sinned: "Go and enter Paradise by My mercy." Sunan of Abu-Dawood