@ラナ,Thanks for posting in Q&A.
From your description, I know you want to restrict local user account accessing work Microsoft 365.
Based on my researching, we can create a conditional access policy to achieve your goal.
1.Create a Conditional Access policy > In Target resources select Cloud apps > Select Office 365.
2.In Grant Session, select Grant access for the work account you allowed, then only work account can access Microsoft 365 resources and personal account cannot access Microsoft 365 resources.
Or you can use GPO to restrict personal account access Microsoft resources.
Non-official, just for reference.
Hope it will help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.