First off is what is the make and model of the external drive.? The reason for asking is that not all external drives play well as external boot drives with all Macs.
With that said, generally the easiest approach is to enter Recovery and use the installer to install macOS on the external drive. You need to make sure you select the external drive as destination. While doing the install with the internal drive selected will not harm anything, it will just be time lost.
The other is to download a copy of the macOS installer and either install from the installer on the internal or create a USB installer and use that.
The other thing to note is that certain features of macOS will not be available when using an external drive. Things like Apple Intelligence and Wallet do not function on an external boot drive.
The other alternative, and most desirable, would be not to external boot at all and simply move all your data to the external drive to free up space on the internal (photos, movies, documents, etc.) and leave the internal with just applications. There are Apple documents that show you how to move the library for Music to the external and the process is essentially the same Movies and Photos apps.