Science
What if science is right and faith is just a way to cope with death?
Explaining why a belief is comforting doesn't tell you whether it's false.
That's the real logical gap in this worry. Believing in an afterlife can bring comfort, and people facing mortality might be drawn toward ideas that soften that fear. None of that tells you whether those ideas are also true.
The same move works in reverse: you could just as easily suggest atheism appeals to people who don't want to be accountable to anyone. That wouldn't prove atheism false either. A belief's appeal and its truth are simply different questions.
Christianity also doesn't ask you to choose between science and faith. Science is well-suited to explaining how the physical world works. It isn't equipped to settle whether a specific man was raised from the dead two thousand years ago—that's a historical question, not a scientific one.
So the real question isn't whether faith would comfort you. It's whether it's true.
Bible quotations in these answers are generally taken from the Christian Standard Bible®, Copyright © 2017 by Holman Bible Publishers. Used by permission. Christian Standard Bible® and CSB® are federally registered trademarks of Holman Bible Publishers. Some biblical wording may be paraphrased or follow other translations.