Proximity sensor not working

I go to test the hardware in my settings and it tells me the proximity sensor is not working I tried to do a test on it and it fails How do I fix it

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0

crwdns2947414:01crwdne2947414:0:

Proximity sensor failure on a Motorola Moto G Stylus 5G (2024) usually comes from three sources:

1. Software issue

Restart in safe mode to rule out third-party apps.

Update firmware via Settings → System → Updates.

Clear cache partition from recovery mode.

2. Obstruction

Check if a screen protector or case is covering the sensor area near the top bezel.

Clean the glass above the sensor.

3. Hardware fault

If the built-in hardware test fails repeatedly, the sensor module may be defective.

Only fix is service: replacing the proximity/light sensor flex cable or full display assembly (sensor is usually integrated).

Next step: If cleaning and software resets don’t help, this is hardware. Phone must go to warranty service or repair shop.

crwdns2934271:0crwdnd2934271:0crwdne2934271:0

crwdns2934285:0crwdne2934285:0