The Gemara Shabbos (104a) says: בא ליטמא פותחין לו בא ליטהר מסייעים אותו
Translation: "If one comes to become impure [i.e. sin] they [i.e. heavenly forces] open (the way) for him. If one comes to become pure they [i.e. heavenly forces] help him"