God has a problem! He loves us and wants to be in fellowship with us. That is why He created Adam and Eve in the first place, but His love cannot override His other attributes. God is at all times perfectly loving, completely holy, absolutely just, and blessedly merciful. God is holy, so He cannot tolerate sin. God is just, so sin must be punished. God loves us and wants to be merciful. He does not want anyone to go to hell, but desires that all come to repentance and live eternally in heaven with Him. Ignoring our sins would violate His holiness.
If He were to give us a free pass, then it would compromise His justice. What is God to do? Thank God for Jesus! God loves us so much that He sent His own Son, Jesus Christ, to die in our place, taking the punishment for our sins and satisfying God's justice. With payment made, God is free to pour out His mercy, forgiving our sins and blotting out the record of the debt we owed. Solely on the basis of faith in Christ's sacrifice on our behalf, God cleanses us of all unrighteousness and allows us into His holy presence. When we meet Jesus Christ at the cross in faith and repentance, He takes our sins upon Himself and covers us with His righteousness. This is the essence of the gospel, and it is the only possible solution to God's problem--and ours.