There are many tutorials in general section but have a look here:
it's a good place to start and have video tutorials on how to root your device.
Please note, rooting is different for different builds (4.12 vs 4.22 vs 4.3 etc) so make sure you follow the guides for your particular builds..
the newer ones might require a certain bootloader.
*also check out Chainfire CF-Auto-Root
If you need help, check the FAQ first for whatever ROM you're on. Then ask questions.