Laws specifying whether you can be required to provide your decryption key or password for data files to law enforcement or other agencies vary depending on the country you live in. US courts seem to (so far) be saying that doing so would violate an individual's Fifth Amendment rights.
The United States is a legal and logistical nightmare in such matters. They have Supreme Courts and Federal Courts.
This source that I found says that in 2019, the Massachusetts Supreme Court forced a defendant to reveal the unlocking code for this phone. During the same year, Pennsylvania’s Supreme Court ruled that an accused individual does not have to disclose the password for his computer. Those are just some cases with courts of the highest level.
When it comes to Federal Courts, the Third Circuit Court of Appeals ruled that a defendant had to unlock multiple computers and devices. But, the 11th Circuit Court of Appeals ruled in favor of the defendant in a similar case.
Then we have the issue of biometrics. The source says:
Law enforcement is allowed to use people’s bodies as evidence against them, for instance by compelling them to participate in suspect lineups or provide their DNA. So if the police can take your fingerprints, can’t they use them to unlock your phone?
...
courts have been more likely to rule that the Fifth Amendment does not apply to biometrics than they are that it applies to passcodes.
...
Yet another factor to consider here is that, while it’s impossible for police to read your mind and get your passcode, they can hold a phone up to your face or press your finger on it to bypass the biometric lock. And while your lawyer can (and should) argue that any evidence found this way was illegally obtained and should be suppressed, there’s no guarantee they’ll win.
The conclusion is that it's safer to use a password/pin code than biometrics when it comes to password-protecting your personal devices.
So, all things considered, if you’re worried about law enforcement getting access to your phone, your safest bet is to just use a passcode.
*
All quotes are from the source mentioned above.