Enchanted Books in Minecraft are your main way to equip enchantments to your armor, weapons, and other specific items to get more use out of them. While what enchantment the book provides will be randomized when you get it, this is a much more straightforward way of knowing what you are getting rather than through an Enchantment Table. Here is how to get Enchanted Books in Minecraft.
Chests
As you explore areas in your seed, you can come across chests in pre-rendered areas like Nether Fortresses, Temples, and more. You can get a large variety of items from them like food, ores, and of course, Enchanted Books.
Enchantment Table
You can apply enchantments to regular books the same way you do with other items. You will need Lapis Lazuli on top of experience to pay to upgrade them, so this is not necessarily one of our most recommended ways to get Enchanted Books.
Fishing
The best way to get a lot of Enchantment Books is to go fishing for them in any water source block. All you need is a Fishing Rod and endlessly throw it in the water to grab the treasure. You can increase the chances to get better loot by equipping Luck of the Sea to the Fishing Rod.
Piglins
If you have Gold Ingots, you can take them to Piglins in the Nether and barter for a small chance for them to give you an Enchanted Book.
Raids
If you start a raid at a village, you can potentially get Enchanted Books to drop from defeating Vindicators or Villagers. The odds of this happening, though, are small.
Trading
Finally, you can purchase Enchanted Books from Villagers by trading with them. To acquire them, you need to offer up regular books and Emeralds.