Transition to a managed identity, service principal, or workload identity - https://learn.microsoft.com/en-us/entra/architecture/service-accounts-principal#move-from-a-user-account-to-a-service-principal
If using a service principal, secure by following https://www.christianfrohn.dk/2024/04/22/securing-service-principals-in-microsoft-entra-id-with-conditional-access-policies/
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin