An atheist asked me that if somebody who does not believe in God but lives a good life, does a lot of charity work etc. will still go to Hell because they rejected God.
The atheist believes if this were true that there would be no point for them to be good at all as they would be doomed anyway.
How do you answer this tactfully?
I’m not exactly known for tact

but I would say something like this.
"When your friend rejected God, it is entirely possible that what he rejected was not God Himself. Many people think that God is distant, cruel, uncaring, capricious, punitive, wrathful, demanding, and rigid --and since none of those are ‘loving’ attributes, they will not love and serve ‘such a being.’
But is God HIMSELF any of those things? He is not.
Therefore the ‘god’ your friend rejected, who was all those things, is not God, the real God.
By doing good things your friend was, even if he didn’t realize it, serving the REAL God, through whom all good things are done.
Also, at the moment of death, your friend may have been granted the chance to see God ‘as He was’, and to joyfully accept Him.
Nobody goes to hell unknowingly or unwittingly. If your friend did not mean to reject the real God, but only rejected a man-made one who was evil and cruel. . . if your friend, by his actions and life, truly was trying to love and help people, then he was trying to love and serve God as well and in the end when He meets the true Master, he will run to Him with joy and say, “It is YOU whom I truly loved and longed for and served.” And he will be welcomed into heaven with rejoicing.