1. Update stock firmware OTA normally, just check in settings under about or around that area of settings to see if there is an update. I believe 9.0.2 was the newest.
2. This looks a good guide for rooting and install magisk https://oneplus.gadgethacks.com/how-to/ ... e-0185541/ I just suggest you install this version of TWRP https://forum.xda-developers.com/devdb/ ... /?id=30485 over the one linked in the guide (seems to be tweaked for the OP6).
3. Flash this via TWRP (your recovery) https://forum.xda-developers.com/oneplu ... d-t3799167 you can adjust what tweaks you want and the flash options, just read through the first and second posts to see how.
4. Buy and install franco kernel manager from playstore (worth it). Use the app to flash franco kernel for you. Go through the battery life labs section of the app to tweak your phone for more battery. I suggest underclocking your cpu to 50% or 25% (Im using 50%, I tried 75% which was also very good but this is where you to start to notice a little loss in performance), enabling the gpu underclock (unless you play heavy games), and enabling the power saving profile. There will be literally no noticable performance hits, hiccups or lag with these settings unless you play heavy 3D games. If you dont want to spend money you can flash the kernel from zip https://kernels.franco-lnx.net/OnePlus6/9/anyKernel/ then download some sort of free kernel manager and do the tweaks on your own through that app.
I did this all on day 2 or 3 of having the phone. Haven't had to do anything since. Just had one kernel update since, which the franco kernel manager installed for me easily enough.