Solved! My laptop keeps looping an error screen after a factory restart

Aug 9, 2021
So I factory reset my Lenovo laptop today and I went away and then I came back and an error popped up saying,
"The computer restarted unexpectedly or encountered an unexpected error. Windows installation cannot proceed. To install Windows, click "OK" to restart the computer and then restart the installation" so I click ok and then it'll restart and pop up again, it just keeps looping that basically