This is a harsh warning that Joshua gave to the children of Israel. There are consequences to turning away from the Lord and following after false gods. God is a jealous and Holy God and desires us to follow Him with all our hearts. This warning should have been clear to them especially after all of the false gods they went to war against. But still some of them followed after these false gods (Joshua 24:23).
After living a life of sin, I think to myself how is it that anyone would want to go back? After God has reconciled me to Him, why would I want to go back to my old way of life? I have seen the Lord do some wonderful things. He has cleaned up my finances, He has cut all of my desires for alcohol that I once had, and He has always been there for me. But Joshua had to stress the importance of following after a Holy and just God. The last thing you want is for a Holy and Just God to turn from you after He has done you good.
Forsaking the false gods and following the Lord,