If death in a rpg can be a problem, a TPK (Total Party Kill) is a defeat, both for party and DM.
If you've got the "Hurrah! I've just killed the entire party!I'm cool" syndrome then stop reading; you can't DMing yet.
On a TPK probably something went wrong. Maybe you didn't handle stuff rightly or you made an unbalanced encounter.
If you're arriving to a TPK, let's see some advices to slightly chance the situation and let your players one last chance.
Enemies don't kill PCs but they make them captives.
If they're intelligent and civilized they've taken them for a sacrifice, to judge and then execute them or for ransom.
In they're non-intelligent monsters of if they're uncivilized they've taken prisoners for provisions or to make them slaves.
PCs are taken as slaves.
Masters can be the same enemies or maybe they're sold to others.
Stripped of anything
PCs have lost but they've survived. Enemies's only aim was to stun them and to take their equipment.
After a few hours PCs wake up without their magical items and most of their objects.
Saved at the last second
A Group of NPCs (or a single powerful one) suddenly appears and save the day.
You can think it's too ordinary but you could introduce some important NPCs or maybe new allies.
With those advices you can start new adventures or even a new development for your campaign.
Then you just only have to choose how to carry on.