Getting mobs in Minecraft to go to areas you want them in can be complicated without the proper materials. You could always try pushing them, but odds are they will either walk away, or you will get frustrated. Hitting them leaves the potential for you to kill them accidentally. With that in mind, you are going to want to use Leads. Here is how you can make them or find them.
Related: The 10 best Minecraft mods
How to make Leads in Minecraft
To make a Lead in Minecraft, you will need a Slimeball and four pieces of String. The String is easy to get — killing spiders that are common hostile mobs will likely drop the ones you need, but you can also find it in chests scattered around the world or use cobwebs to make it. The Slimeball can only be obtained by defeating Slimes. You can find them commonly in Swamp biomes but occasionally find them underground. When Slimes are larger, strike them until they break into smaller Slimes. Those small ones are the only ones that can drop the Slimeball item. For a guaranteed chance to get a Slimeball, have a nearby Frog eat the small Slime.
When you have your Slimeball and four String, go to a Crafting Table. The crafting recipe for the Lead includes putting the Slimeball in the center slot and the String in the bottom right, middle left, top left, and top center slots. This process will make two Leads that you can now move to your inventory.
How to use a Lead in Minecraft
Leads are essentially leashes that you can put on passive animal mobs to get them to follow you around. Horses, Donkeys, Mules, Pigs, Chickens, Rabbits, Sheep, and Cows can all be roped up, but hostile mobs like Spiders and Zombies can not.
Additionally, when you have an animal tied up, you can then connect the other end of that Lead to a Fence post, and they will be tied to it. Any animal attached to a Lead will not despawn, so you can use this to prevent that if you do not have any Name Tags.