I think I found a bug in my motherboard's BIOS. When you have a drive with a unformated uefi boot partition plugged in, the whole computer freezes when you try to enter the bios setup.
@matrixhttps://gparted.org/livecd.php This has saved me multiple times. It hasn't been updated for years, but for basic partitioning it still works fine.
@phnt I can't open the boot menu or BIOS screen. I would have to unplug drives (a lot of work because they're NVME). I think Windows has some cmd tool that should let me do it.