I found the solution! Most of the other answers were totally useless or not correlated or not providing a solution.
You need to follow these steps:
(1) open Settings > Accounts > Access work or school > Add a work or school account > Connect
(2) If already available, click on Join this device to Microsoft Entra ID
If not, you first need to insert your work/school email address, than click on the above link.
(3) Click on Join this device to Microsoft Entra ID
(4) Insert your Microsoft work account credentials
(5) Confirm by clicking on Join
Now you will be able to logout from the current account and use a work account for logging in. Unfortunately, I believe you cannot convert a local account into a Microsoft work account.