Factory reset is probably all you need.
This wipes the user data partition, which deletes all your apps, and it also deletes any accounts on the phone.
Do that, then run the Universal Debloat Utility disabling only the "safe" category. https://github.com/0x192/universal-android-debloater
This is about the best you can easily do on Samsung, since they're a bit bloated. It's made a significant difference on some lower-end Sammy's of friends and family (like the A series).
Alternatively, if you don't want to reset everything, you can try uninstalling what you don't use (or anything that would be easy to reinstall), then run SD Maid and have it clean up orphans, etc. Then run Debloat.
Keep in mind that as your data partition fills up, it can slow the phone. I find that under about 15%-20% free space I start to see lags.