Question: do villagers need beds to live?
Answer: Housing. A villager needs a house to stay in and be sheltered from threats such as Illagers and Zombies, which will attack villagers on sight. Below are a few houses that you can make for them. Please note that as of 1.14, villagers consider a bed to be a house.