Welcome to Android Central! It's been something that started showing up around February or so:
https://www.theverge.com/2021/2/18/2...-working-issue. If the problem persists in Safe Mode or after clearing cache/data, the next step may be to do a factory reset.
If that still doesn't fix it, then it may just be a hardware failure, which unfortunately can happen with any device. For a 4 year old device, you wouldn't have many other options besides bringing it to a repair shop or getting a new phone. Sorry!