Is it more important to believe in God or to live a good life?
Living a good life while not believing in God will get you nowhere. Belief and trust in the Lord leads people to clean up their lives. You cannot say that you believe in Jesus Christ but then live a rotten life. "What good is it, my brothers, if a man claims to have faith but has no deeds?... faith by itself, if it is not accompanied by action, is dead" (James 2:14,17).
However, you are not saved by your actions. No person could ever be good enough to earn God's favor. Salvation is obtained only through the perfect blood of Jesus Christ. "For it is by grace you have been saved, through faith ... not by works, so that no one can boast" (Eph. 2:8-9).
So, faith and works go hand in hand. But, salvation comes by grace through faith, not works. Good works are a byproduct of a life changed by the grace of Jesus Christ.