Default [Q] Rooting and restoring Query

Hi Guys,

First of I'd like to apologize if I have posted in the wrong section.

I have a question relating to rooting and restoring my device (HTC One M8[Currently using the Telstra handset from Australia), could somebody please point me to the right direction to where I can start off in order for me to root/restore my phone.

At this stage, I have no idea to where I can start off reading about rooting phones on an Android device. All my devices I have in the past was an iOS product from Apple.

And as to S-ON & S-OFF is it possible to restore my device back to the Telstra original stock version and have S-ON switched back on? Will HTC know that I have tampered with the S-On & S-Off? As for Apple, I know that if I were to restore it back to Apple original iOS version I would be able to do that to either sell my phone or to take it back to Apple for warranty purposes.

Apologize in advance as this rooting scene on an android device is completely new to me.

Any information or informative/tutorial links would be much appreciated.