I use Maxlock available at https://github.com/Maxr1998/MaxLock. Though it hasn't been updated in a while, I haven't come across any other open-source or closed-source alternatives with its level of functionality. Maxlock enables me to secure almost anything on a phone with a password of choice. This includes locking individual apps, phone settings, specific file and folder access, and even preventing the uninstallation of apps like Maxlock itself.
I've set a very long password for my browser and limit the number of apps installed, (e.g. social media and games). Additionally, when I'm at home, I maximize the volume for messages and phone call notifications turning off other notifications. To further reduce distractions, I place my phone in an adjacent room, keeping it out of sight and out of mind.
If you have a large house, you can connect your phone to a Bluetooth speaker to hear notifications from a distance while leaving the phone in another room.
If you use it, make sure to write down your password. Don't make the same mistake I did, ultimately it was so locked down I needed to reset the phone.
Ultimately, it all comes down to having the willpower to stick to it.