Minecraft wiki entry for Curing_a_zombie_villager, associated text: In the Overworld at a light level of 7 or less. It spawns in all land biomes except mushroom fields.
In a swamp hut located in swamp biomes. However, they do not generate in the swamp hills biome variant.‌‌[Java Edition only]
When an adult or baby villager is at least 4 blocks away from a lightning strike.
In raids starting from wave 4 in Bedrock Edition, or wave 3 or 4 in Java Edition depending on the world difficulty.