In survival Minecraft you generally cannot craft mob spawners from scratch, but you can find them in generated structures such as dungeons and then build a farm around them. Other types of farms rely on dark rooms or specific game mechanics to spawn mobs without using a spawner block.
Once you locate a spawner, players usually clear the surrounding area, control the light level and design a system that moves mobs to a safe killing area, where drops can be collected. The exact layout depends on the version and difficulty, so it is best to follow up‑to‑date community tutorials for your edition of the game.