You're given a good bit of leeway during battles in Baldur's Gate 3 before you or a companion actually bites the dust for good. While in battle, if a teammate does take enough damage to drop, they aren't dead then and there. Instead, they will be downed with a chance to roll every turn to get back up. If they roll successfully three times, the battle ends, or you use another character to pick them up, they're good. If they fail that roll three times, however, they will be completely dead. That can be harsh when you've become attached to certain characters and want to further their stories, so you'll be looking for any way you can to bring them back. Thankfully you do have a few options for reviving companions in Baldur's Gate 3, but just like respeccing, they aren't so obvious.
Pay Withers to bring them back
Withers is a friendly undead you can find in a secret room in the Dank Crypt found inside the Overgrown Ruins. After finding and speaking to him in his sarcophagus, he will offer you various services, one of which is bringing back any dead companions. He won't do this out of the kindness of his heart (probably because it isn't beating) and will charge you a heavy fine of 200 gold to do so. Still, that's a small price to pay to bring back a beloved character. Once paid, that character will appear in your camp where they would normally be, so there's no need to go back to their corpse and find them.
Use a scroll of Revivfy or learn it