Minecraft wiki entry for Enchanting, associated text: Through a villager, who may trade some enchanted items for emeralds.
Through fishing, which gives a chance of obtaining enchanted items.
Through a zombie, drowned, husk, piglin, skeleton, stray, wither skeleton, and zombified piglin – if they have enchanted items and the player kills them, it has an 8.5% chance of them dropping each said item.
Through finding them in end cities and other assorted treasure chests, such as shipwrecks, mineshafts, dungeons, desert temples, jungle temples, woodland mansions, ocean ruins, strongholds, ruined portals, and bastion remnants.
Through bartering possibly receiving an enchanted book or iron boots with Soul Speed(random level).
Through killing pillagers and vindicators in raids.‌[Bedrock Edition only]