To change the villager’s professions in the Minecraft game, all you have to do is to get the villagers and take them to your house. You have to build a house of any size for them. You need a bed and whatever you want like lectern or smithing and a fletching table.
The villagers need to buy whatever station you put down to reset their inventory. So when you buy something it won’t be in stock. So if you break the bed, he will have a Depth Strider Book, Lantern and a Bookshelf.
You have to put the bed back and you will see the green sparkles there. It means a new villager has been created.
When you go back to him, you will also see the green sparkles on the villager.
Now the villagers will have different things like Glass and Enchanting Book. If you are going to do this process again and again, you can get any legendary book from him.
If you break the bed again, and go to him, this time it will be an Infinity Book, Bookshelf, and Glass.
If you want a librarian and a smithy, you can build up like this for the villagers. You can build this as many times as you want but one is quite enough. When you buy something from them, you will not be able to buy it for a few minutes. Just go around for some time and then get back to them.