Early game: mine smart, kill on purpose
Before your first farm, XP comes from three places: mining ores that drop experience (coal, diamond, lapis, redstone, emerald — smelting-free ores pay on the spot), killing hostile mobs (5 points each, blazes 10), and breeding animals. A simple night-one habit: fight what comes to you instead of hiding, and you'll hit the enchanting table a day sooner.
The classic spawner grinder
A dungeon spawner (zombie or skeleton) converted into a dark-room kill chamber earns roughly 5 points per spawn with zero risk. Build the floor so mobs funnel into a 1-block drop that leaves them one punch from death — you keep the XP by finishing them yourself, because mobs that die from fall or lava damage drop nothing.
Late game: points by the thousand
Endgame farms trade build effort for throughput: an enderman farm in The End can produce thousands of points per hour, and furnace arrays that smelt stacks of cobblestone or kelp bank points you collect when you take the output. Bottles o' Enchanting from cleric villagers convert emeralds into 3–11 points per bottle — a great dump for surplus emeralds before a big enchanting session.
Spending without waste
Enchanting spends points and levels together, so the cheapest strategy is to bank points early and stay under level 40 — past that, every purchase costs more levels for the same points. Combine books on an anvil before touching your gear, and remember gear with a high prior-work penalty can hit the 'Too Expensive!' wall where no anvil operation is allowed at all.