Sometimes it takes a serious crisis like this to wake us up and make us realize our need of God -- and I believe this is what is happening to you. After all, would you have ever thought seriously about your eternal salvation and your need for Christ otherwise? Probably not.
No, it isn't too late for you to turn to God. In fact, I believe God has spared your life so you'd have another opportunity to turn to Him. I pray you won't ignore this. The Bible says, "He is patient with you, not wanting anyone to perish, but everyone to come to repentance" (2 Peter 3:9). God loves you, and He doesn't want you to die and spend eternity apart from Him.
And you don't have to, because God has provided the way for you to be saved. That way is Jesus Christ, who gave His life as the final and complete sacrifice for your sins. Only one thing will keep you out of Heaven, and that is your sins. But on the cross all your sins were placed on Christ, and He took upon Himself the death and Hell that you deserve. Don't let another day go by without Him, but by faith open your heart and life to Him and trust Him for your salvation.
Then face the future with confidence, knowing that God is always with you, and He will never abandon you. If your life is spared, make it your goal to live for Christ every day. But even if it isn't, rejoice in the glorious hope we have because of Him.