From Twinfinite: “Villagers can be very helpful in Minecraft as theyre passive and can be traded with. Theyll be wearing one of six colored outfits, which depend on their profession, but their state can be changed if theyre attacked by some of the games many creatures. If a villager gets attacked by a zombie, theyll turn into a zombie villager, which means theyll try to attack you and you will not be able to trade with them. However, if this happens in your world, youll be happy to hear that you are able to cure a zombie villager, and heres how you can do so.”

Source: N4G PC Minecraft: How to Cure a Zombie Villager