It’s also possible for someone to become a child’s guardian if their parents lose the ability to fill that role. I don’t know how widespread this is across cultures, but in my family, parents of newborn children name a “godfather” and/or “godmother” (usually an aunt/uncle) who become responsible for this by default.