If the device fails to register your face for the Face ID option, you must check whether you are scanning it in a room that is properly lit.
Often, users face trouble with the feature after setting the Face ID; if you find it difficult to unlock the phone with your face, looking at the screen actively unlocks it easily. The phone needs to get your attention to work properly.
The Face ID may learn your face once when you set it up; so, it might not register constant changes in your appearance.
If the issues continue after this, you can contact Apple Support or take it to an authorized service center.