You can run the Microsoft Entra ID user status batch job to disable users in D365 F&SCM if these users no longer exist in the Microsoft Entra ID.
Steps
Go to Security and compliance > Periodic tasks > Apply Microsoft Entra ID user status
Expand the Run in the background section.
Select Yes in the Batch processing field.
You are advised to run this batch job in a recurring pattern. So, you always have up-to-date license usage counts. And so, you can reduce license costs.
Click Recurrence.
Define the recurring pattern as desired.
Click OK.
Click OK.