How to find the cause when Face ID stops working

I sometimes get iPhones where Face ID doesn't work, either after the front glass has been damaged or replaced, or for no obvious reason.

What's the best way to locate the cause of the problem — and is there any reliable method to make Face ID work again once it has stopped functioning?

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

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0