Hi Ramon Linares,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here
Based on your query,
Please make sure enable boot diagnostics logs on your VM. This will give you access to logs that can help identify the issue and review any recent have you done based on that issue might cause
Please refer the below link for repair the to recover
And also, please review the below link same kind of issue one of the user facing the issue there will be having more troubleshooting on restarts
https://learn.microsoft.com/en-us/answers/questions/1394519/repeated-vm-restarts
Please let me know if you have any further query, I'm happy to help you here