There is no option/switch in the core that will enable you to hide the fields so you will need to create a copy of the profile page to hide the password fields using the standard Joomla template override mechanism for the com_user page(s) you want to alter.
This a simple introduction, https://ltheme.com/create-overrides-in-joomla-4/#create-overrides-for-components, for Joomla 4 that gives a basic understanding but there are plenty more tutorials and documentation available with a quick search on template overrides.
You don't mention which version of Joomla but the basics are the same and I am assuming that you are only wanting to hide the fields in the front end view of the profile edit page.