Unity has stopped working. Unity crashes.

I tried to open a project in unity two days ago. After Unity opened the project my PC powered off. I powered it back on and tried to run the project again only to get an error by Unity saying that Unity has stopped working. I tried running a different project in Unity to see if the problem was in the project and it gave me the same error. I figured the problem was that Unity engine was corrupted so I uninstalled Unity and tried to reinstall the latest version using Unity hub. It kept failing and it wasn’t able to install Unity. I had to reinstall it from the archive. After reinstalling Unity I tried to rerun the project and to my surprise it gave me the exact same error. Here are the details it gave me:

Obtained 21 stack frames
0x00007ff6e138a53d (Unity) StackWalker::GetCurrentCallstack
0x00007ff6e1391299 (Unity) StackWalker::ShowCallstack
0x00007ff6e22f5de3 (Unity) GetStacktrace
0x00007ff6e13902d6 (Unity) winutils::PrintStackTrace
0x00007ff6e1389b6c (Unity) winutils::CrashHandler::DefaultSignalHandler
0x00007ff6e3677dc2 (Unity) seh_filter_exe
0x00007ff6e37372bc (Unity) `__scrt_common_main_seh'::`1'::filt$0
0x00007ff6e3644480 (Unity) _C_specific_handler
0x00007ffd785520cf (ntdll) _chkstk
0x00007ffd78501454 (ntdll) RtlRaiseException
0x00007ffd78550bfe (ntdll) KiUserExceptionDispatcher
0x00007ff6e28b2d18 (Unity) RestService::HttpTransport::CertificateStore::Init
0x00007ff6e28b4756 (Unity) RestService::HttpTransport::Start
0x00007ff6e28added (Unity) RestService::Startup
0x00007ff6e0613a29 (Unity) CallbackArray::Invoke
0x00007ff6e0f6987e (Unity) InitializeEngineNoGraphics
0x00007ff6e1ea6c20 (Unity) Application::InitializeProject
0x00007ff6e2300548 (Unity) WinMain
0x00007ff6e3621d4e (Unity) __scrt_common_main_seh
0x00007ffd776b7034 (KERNEL32) BaseThreadInitThunk
0x00007ffd78502651 (ntdll) RtlUserThreadStart

Please help.

@samirissaayman

I got this possible solution from here:

https://forum.unity.com/threads/crash-on-start-for-unity-edtior.1270190/

“Can you try deleting “%APPDATA%\Roaming\Unity\rest-certificate.pem” and try to start the editor again?”

Since this worked for me and my problem seemed exactly the same as this, with the same 21 stack frames in the crash log, I thought I’d better try to inform whoever else might have this problem that this solution might work.