1. Have external SSD connected.
2. Open disk utility. Go to the view menu and choose "show all devices".
3. Look at the list on the left. Pick "the top line" FOR THE SSD (the physical drive itself), then click erase. Format to APFS, GUID partition format. Quit disk utility.
4. Now download the new OS (Sonoma, right).
5. Let the installer open, and begin "clicking through", BUT, when the installer asks WHERE you want to install, "aim it" at the EXTERNAL SSD.
6. The install should proceed. The Mac may reboot one or more times, and the screen may go dark for a minute or more with no other indication of activity. Be patient.
7. When done, you should be booted from the SSD and see the setup screen (choose your language). So... click through and set it up. You may want to import some data from the internal drive. OR... you might want to start "completely fresh". It's up to you.