Related thought - How did knights in plate armour manage? Were there accomodation for taking a pee without having to take a significsant amount of armour off?
Almost all medieval armour is open from below at the crotch. So, you can just let go, but you'll wet or foul your underwear. Sometimes there are flaps or removable pieces. Sometimes not. It highly depends on the type or armour and the exact time period.
I have a full maille kit for reenactment. I can easily pee while wearing it. I only have to remove my gloves and helmet (so I can see what I'm doing). Defecating is harder but not impossible, but I just go before gearing up. I don't have armour on all day during reenactment events.
The armour needs to be quite flexible in this area anyway as your hips and legs need to bend. they just used flaps of chainmail rather than seal you in. Look at some images.