If you're in the US and a citizen, you do not have to divulge your password to the authorities or even a judge, per the 5th Amendment. However, they can force you to use your fingerprint or FaceID to unlock your phone.
If you think there's a chance the police might want to search your phone, be sure that you have a difficult pin pattern or password to unlock your phone at a minimum. Consider if bringing your phone is necessary. If you're going to a protest, do not bring your primary phone. Get a cheap burner or go without.
If you're not a citizen, you need to think about leaving. Seek asylum anywhere but here. Vacation in Canada. The US is no longer safe for foreigners.
If you’re in the US and a citizen, you do not have to divulge your password to the authorities or even a judge, per the 5th Amendment. However, they can force you to use your fingerprint or FaceID to unlock your phone.
They can, however, probably seize your phone, and refuse to return it to you. Something to keep in mind when deciding to take your primary device, or a burner.
I've set my phone so it will erase if someone enters the PIN backwards (GrapheneOS duress code). It would be fun to watch the authorities wipe the phone.
It hasn't been safe to travel with a phone or laptop since at least the post 9/11 changes to travel rules, at least not into or out of the US and other oppressive regimes that spy on your phone on the border.
I've been to the US twice since 9/11 and neither time was I asked for my phone. Not to say it didn't happen before now. It happens in many countries if they decide they have even a tiny bit of suspicion.
But, frankly right now I would not travel to the USA for any reason.