

Portrayals of the archetypal plague doctor costume of beak-like mask, ankle-length waxed overcoat, gloves, boots, wide-brimmed hat, linen hood, and overcoat date to the early modern period.
The first known written description of an herbal-stuffed beak mask was during the 1656–1658 epidemic in Rome.
https://en.wikipedia.org/wiki/Plague_doctor
Those masks aren’t medieval
It was to protect against miasma
https://en.wikipedia.org/wiki/Miasma_theory