Deuteronomy 4:30 When thou art in tribulation, and all these things are come upon thee, even in the latter days, if thou turn to the Lord thy God, and shalt be obedient unto his voice; 31 (For the Lord thy God is a merciful God;) he will not forsake thee, neither destroy thee, nor forget the covenant of thy fathers which he sware unto them.
God gave them rules and regulations to follow:commandments. He knew that they would walk away. He knew that their rebellion would bring consequences. He knew that they would be hurting.
So even as He gave the commandments and the consequences He reminded them that they could come back. He told them that He was merciful. He told them that He would not leave them. He would not destroy them. He would not forget His promises.
So if you rebel against God you, too, will suffer the consequences. You will see that He only asked you to do what was best for you.
After you remember what is going on you can come back. You can remember how good your God is. If you do not keep your word, He will keep His anyway.
He is a good God. He is loving and kind. He will be here when you get tired of running, the consequences of your sins, and decide that you must return to Him!