Unless you have researched this and are comfortable doing these things, this is not something that's easy to do. I bricked my OnePlus Nord100 not once, but TWICE trying to install Ubuntu Touch.
It happened because the Nord100 shipped with a more current Android version (11.xx) and Ubuntu can only be installed over two very specific versions (10.xx) on the Nord. I bricked it once thinking it could be installed over the 11 version. Then I had to figure out how to reflash the phone back to the 10 version, then run the UBports installer.
I was lucky because I bought the Nord100 for like $50 on ebay so it wasn't a big deal if I wasn't able to unbrick the phone, but if you do this to a more expensive phone, the consequences are a lot more expensive.
I love Lineage OS and have it running on a Pixel 4XL, but my experience flashing and re-flashing the phone several times, and all the work I went into just to get UT running on that phone, really dampened my enthusiasm to ever do this again.