First of all, why root?
Before you are able to utilize any of the amazing custom roms available, you will need to root your phone. However, there are many other reasons why rooting can greatly enhance your android experience. To those that used iphones, rooting is the equivalent of jailbreaking, and basically unlocks your restrictions and gives you full access to everything on your phone. There are a couple reasons why rooting may be beneficial...
1. Privacy Guard/Apps Ops - Dislike the permissions that some apps want and the fact that they can see your contacts, texts, and personal information? With apps ops, you can limit permissions on a per apps basis.
2. Adblock - Who doesn't like ad block?
3. AOSP lockscreen - Especially to those Samsung users that cannot have security and a camera widget at the same time, this is a perfect alternative.
4. Battery friendly - With apps that require root, you can greatly increase your battery life and functionality
5. Latest updates - And of course, there are the beautiful custom roms. Never stay behind in the android world because you don't get OTA's. Benefit from the roms made by xda developers and get the latest android version.
Sounds good? Let's root
To root, you essentially need to unlock your bootloader and flash a custom TWRP.
Unlocking bootloader is done at HTCDev (our device is "all other supported models) and it has detailed instructions on how to do it. If however, you cannot follow or simply want a faster alternative, try an all in one toolkit courtesy of hasoon2000.
Your next step would be to flash a twrp. I'd suggest that you don't use the ones in the toolkit as they might be outdated. Pick one from here or use TWRPSELinux for android 4.4 (for S4 variants with hboot 2.15 or lower. I don't know anything about S3 and hboot 2.16)
type "fastboot flash recovery recovery.img" in adb or use the toolkit.
***Note, if you are done here, I'd suggest that you make a nandroid backup before flashing something else. Additionally, keep your unlock token as you may need it later. Lastly, know that you are s-on (htc only), meaning you will need to flash the boot.img separately after each new rom. Look in the toolkit or here for more details***