Welcome.
That is a simple question, the answer to which is far from simple....rather like 'How do you fly an aeroplane?'
Start by reading a great deal about rooting.
(Rooting is in fact fairly straightforward and easy to do: it's what you do after rooting that can be complicated, and not without risk.)