The answer to that question now depends more on the person asking the question than on God. Through God's mercy and grace, He has provided and revealed to us all a plan by which we can be forgiven if we will humbly submit to the terms of His offer. And really, that is what a good portion of the Bible is about.
We all have sinned and fall short of the glory of God (Romans 3:23). Our lives should glorify Him, and we do not always do so, and our sins condemn us to eternal hell (Romans 6:23). But it is the will of God who created us that none should perish but that all should be saved (1 Timothy 2:3-4, 2 Peter 3:9). Therefore, God has given us the Scriptures revealing to us the gospel, the good news, His plan for our salvation. Now whether we accept it or ignore it is up to us.
Consider the depth of meaning in such brief statements as,
“God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life” (John 3:16).
Or, “He who believes and is baptized will be saved, but he who does not believe will be condemned” (Mark 16:16). Other Scriptures give us instruction of things that precede baptism, such as repentance (Acts 3:19) and confession of faith (Acts 8:36-38). So then, when we are baptized for the remission of our sins (Acts 2:38) we have absolute assurance that God forgives all sins we have ever committed. At that moment we are cleansed from all past sin.
But we are still in the flesh and Satan will do everything he can to get us to sin. So we need to walk closely to the Lord and resist all temptation. But in spite of our best efforts, none of us are living perfectly sinless lives like Jesus was for His entire life. James 3 reminds us how easy it is to sin just by what we say. In a moment of anger or disgust, it is so easy to sin in what we say or do or think. After baptism, we still have to contend with the lust of the flesh, the lust of the eyes, and the pride of life (1 John 2:15-17). The world wallows in wickedness and we must use every effort to avoid conforming to the world (Romans 12:2).
But sometimes we sin, even unknowingly at the time. When Peter heard the rooster crow after he had denied the Lord, he immediately realized what he had just done (Matthew 26:74-75). Sooner or later, if we have knowledge of the Scriptures, our own conscience convicts us of our sins, but we are not hopelessly lost because we have sinned. Thank God that those of us who have been baptized and are in Christ have Him as our advocate and the propitiation for our sins (1 John 2:1-2).
If we always repent for our misdeeds and do whatever we can to make amends and ask God for forgiveness, we have His promise that He forgives.
“If we say that we have no sin, we deceive ourselves and the truth is not in us. If we confess our sins, He is faithful and just to forgive us our sins and to cleanse us from all unrighteousness. If we say that we have not sinned, we make Him to be a liar, and His word is not in us” (1 John 1:8-10).
“These things I have written to you who believe in the name of the Son of God, that you may know that you have eternal life, and that you may continue to believe in the name of the Son of God” (1 John 5:13).
God does not want us to constantly wonder if He can forgive us. He forgave Peter. He forgave Paul. His promises are true, and He wants us to believe in all He has promised and come to Him with a contrite heart and faith. But let no one use the thought of His grace and willingness to forgive as justification to continue in sin.
“Shall we continue in sin that grace may abound? Certainly not! How shall we who died to sin live any longer in it? Or do you not know that as many of us as were baptized into Christ Jesus were baptized into His death? Therefore, we were buried with Him through baptism into death, that just as Christ was raised from the dead by the glory of the Father, even so we also should walk in newness of life” (Romans 6:1-4).
If we believe in the Lord with all our heart, obey His word, and submit to His plan for our forgiveness when we realize we have sinned and ask His forgiveness, we can rest in peace with confidence that He forgives.