Complicated. 5th amendment protections against self-incrimination prevents the court from using the fact that you
can unlock your phone with a password you know from being used against you. Court opinion has been mixed as to whether you can have an obligation to reveal a password. Even then, the government requires a warrant to search the phone, and that requires a reasonable belief that they would find evidence on it. They can't just go fishing and make you help them.
There's less protection for fingerprint based unlock mechanisms and the like. It's not "something you know", so they're free to compel you to provide it.