Find a village with an unemployed villager
Place a lectern near the villager
Wait for the villager to claim the lectern
Make sure the villager has not already chosen a different profession
If needed, break and replace the lectern until the villager becomes a librarian
Trade with the librarian to lock in the profession
Keep the lectern nearby if you want to reset trades before trading
