I did this with a 2017 iMac to speed up everything with an external SSD connected via USB C
I formatted an external drive, then set the boot up drive to be the external drive . When I rebooted, I restored the OS to the default, then upgraded and got most of what I needed to restore my setup from iCloud backups. I could see the internal drive as available while running the OS from the external drive.
After running this way for several months, I eventually went back to the internal drive as the boot drive. I did this because the external drive occasionally hung up during boot up. I always wondered if USB C was the best way to connect. Some things I did on the external - like upgrading the OS - forced the internal drive to be the boot drive after rebooting. I found that my original internal drive ran much better after reformatting and reloading the OS. Fortunately, I have an M1 laptop and didn't depend on the iMac as a primary computer.
I didn't provide step-by-step instructions because I went back to the original setup and wanted to give you an overview.