Unlock the bootloader if your phone manufacturer allows it
Back up all important data
Install the correct USB drivers on your computer
Enable Developer Options on your phone
Turn on USB Debugging
Download the correct firmware and rooting files for your exact phone model
Install a compatible custom recovery if required
Flash the rooting package using the approved method for your device
Reboot the phone
Verify root access with a root checker app
Re-locking the bootloader is usually not recommended after rooting
Be aware that rooting can void your warranty and may brick the device
