In-display fingerprint scanners have been a trendy way to unlock your phone, where the fingerprint sensor is located under the screen. Its generally possible only in amoled display, but some brands have come through a technology to use those sensons in IPS panel but they are not commercial.
Optical fingerprint scanner

Its the sensor where it takes a 2D image of the fingerprint by lighting up the device at the portion of the sensor and stores it on your device and when to try to unlock the phone, it checks if the image which is saved is same as the finger which is trying to unlock the device. So, if the image is similar, it unlocks the device. It does not work some times when your finger is dirty or oily.
Ultrasonic fingerprint scanner

ultrasonic fingerprint scanner uses very high-frequency sound. The waves are used to map out the details of the user’s fingerprint. When you try to unlock the device, the screen lights up and checks the pulse’s pressure. If it matches, then the device is unlocked. Its more secure than optical fingerprint scanner, and even costlier. It works even though your finger is oily. You can now see these sensons only in some high-end flagships.