Howdy Fnorf,
It’s great to have you in the Apple Support Communities! I gather that you are having issues locking your screen with the side button. I'm happy to help out with that.
If you are currently using a case, cover or any other accessories, please remove those.
Also, make sure you're using the latest version of iOS which would be iOS 13.5.1. This article will assist with updating if needed: Update your iPhone, iPad, or iPod touch
If the issue persists, try restoring to factory settings using iTunes. This process will erase your iPhone, fixing any software related issues.
How to back up your iPhone, iPad, and iPod touch
Restore your iPhone, iPad, or iPod to factory settings
Then set up your iPhone as new and test while in factory settings.
If you continue to run into issues after trying those steps, please reach out here for additional support: Contact Apple Support
Have a great rest of your day!