One of the quickest ways to lose the favour of God is disobedience. The moment you outgrow divine instructions, you are on the slippery path to destruction. No one will be against you but God’s word.
One way to look at this is to study the history of God’s chosen people, the Israelites. Every time they obey God and do His will, all is well. But the moment they go against God’s will and refuse to repent, God becomes their enemy and gives them over to their enemies.