Apple released a lot of new features on their latest beta update on the iPhones. Face ID with mask happens to be one major update released by Apple on IOS 15.4 Beta.
The frustration you might have had personally with Face ID and wearing a Mask were reduced for people who had Apple Watch but still it was quite all the way there because if you had not owned an Apple Watch you were left behind without having that. But this new update Apple does not leave you out, almost all the one the ability to unlock the phone while wearing a mask, even you can authenticate third party apps with this update.
How this feature works is it recognizes the unique features around your eyes for authentication. You will have to rescan your face again to use this feature by toggling the Face ID with mask button, now it even has an option to add glasses if you wear one.
Now it is important to note that it is not going to work on all the devices as of now if you have iPhone 12 and newer models, you are covered and will be able to enjoy the feature after it releases on stable version.