You can use Administrative units to restrict the scope of the User management role: https://learn.microsoft.com/en-us/entra/identity/role-based-access-control/administrative-units
If you also want to restrict the set of actions allowed, you will have to create a custom role: https://learn.microsoft.com/en-us/entra/identity/role-based-access-control/custom-create
Do note that not all operations are currently supported for custom roles.