I think kids come to learn this on their own. But at the same time, normalizing being open about emotions is a good thing, to help promote an environment where saying “I’m okay, I’m just having a rough day today” is something that’s just normal.
But there’s a sense of security to parents being infallible that can be dangerous to break. I lost that feeling with my mother when I was five, in a pretty major way to be fair, and for the next few years I had nightmares about everyone I loved dying and I wouldn’t be able to stop them. Kids are powerless to the world around them in a lot of ways, and rely on adults to protect them and teach them how to protect themselves. So by seeing your parents as able to get through anything, you have a sense of safety at home.
So basically, normalize small challenges and openings to not be perfect, but be trying your best. Allow being human. But make sure the kid knows that no matter what, you will make sure both you and them are okay. Normalize the bumps in the road, and always reaching the end alright.