Unless whatever you are running won't work on the current macOS Big Sur, its generally recommended to go to the newest version your Mac can run.
If you really need to update to Catalina, you can download the installer from the following support document: link-> How to get old versions of macOS - Apple Support
Once downloaded you can simply double click the installer and follow the onscreen prompts.
You don't need to factory restore and unless you have some major issue with your current OS, its hardly recommended to go to all that trouble just to upgrade. It is recommended to have a current backup of your computer just in case something goes wrong. It should not be necessary, but better to be safe than sorry.
If you prefer to go straight too Big Sur then follow the steps here: link-> How to upgrade to macOS Big Sur - Apple Support