When I finish a long-running D&D campaign, I always ensure the last session includes the following for each character:
- A dream fulfilled.
- A surprise.
- A choice.
A Dream Fulfilled
Characters (and the players behind them) have goals. By the end of the campaign, let them achieve one of the big ones—ascension to godhood, becoming the archmage, etc.
The game is full of surprises and I love carrying that spirit into the finale. It's no fun if the characters got everything they wanted and expected. Throw in a surprise to keep things exciting—an old ally resurfaces, the character is asked to lead a nation, etc.
This is my favorite. Give each player character a choice to make during the session. The decision shouldn't influence the trajectory of the campaign since it's about to end. But it gives the player one last bit of agency and it can give you worldbuilding ammunition for future games. One last choice—become the archmage or hunt down the Prince of Frost, join this faction or disappear into the wilderness, etc.
These three can occur throughout the session or they can all fall after the climax, while things are winding down and the story comes to a close. Remember them the next time you need a satisfying player character ending.