This app was mentioned in 2 comments, with an average of 1.00 upvote
There's an app called Pocket Screen Lock which prevents the screen coming on when the sensor is covered (e.I. When it's in a pocket, etc.) I was the king of pocket dialing and this app solved it for me, it's excellent.
https://play.google.com/store/apps/details?id=com.goldenpie.psl&hl=en_GB
https://play.google.com/store/apps/details?id=com.goldenpie.psl this app makes it so the phone doesn't turn on in your pocket