Adventurers are always remembered for what they’ve done in life, but does it actually have to stop there? From the moment I was assigned the position of Dungeon Master for my group of friends, I decided that I would make every character's death as significant as the life of the character. Dungeons and Dragons is a game after all, who would feel satisfied if their character just fell over and die? It may be more realistic, but DnD isn’t about realism in any form. We want to live these fantasy-filled lives and do things that we could never do in real life. By reflecting that into the death of any character, you can take a moment that would normally disappoint a player and turn it into a moment they will never forget.
Constructing meaningful deaths play an essential part in building the overall narrative of the campaign, adding depth through the tragedy of losing a companion. This is especially true for campaigns where the players start at level 1, where the players and characters have been given time to form bonds with each other. I'm not saying you need to have all the players build a funeral pyre the moment someone dies, but give the players a description they won't forget. Paint a scene for them, you can even add a little music to add to the mood.
Another option is to have the character die for a cause, like sacrificing themselves to allow the rest of the party get the killing blow on the boss. It doesn't have to be something grandiose either, it could be something as small as their spirit giving a buff to the party. I always try to make a character's death be for a greater cause, like allowing a god to reincarnate in the mortal plane or close a portal to another another plane, but I have a flair for the dramatic.
Regardless of what you choose to do, I highly suggest you talk to your players and get a feel for what it is that they want. Consider the backstory of each character and what would make each of them die less miserably. Sure, they may not have been able to finish the quest, but at least they did something or will be remembered in some way.
Let me know what you think in the comment section below!