God is good! He has provided the way to connect with Him. It is a gift from Him, not based on our own works. Salvation – the way to a relationship with God – is by grace, through faith alone, not by works.
The Bible tells us in Ephesians 2:8-9, For by grace you have been saved through faith, and that not of yourselves; it is the gift of God, not of works, lest anyone should boast.