Thanks for reaching out to Microsoft Q&A.
You can unjoin the device from Entra ID by following the steps on the following documentation - https://learn.microsoft.com/en-us/entra/identity/devices/faq#how-do-i-remove-a-microsoft-entra-registered-state-for-a-device-locally
Let me know if you need further help.
Thanks,
Fabio