I am going to factory reset it. I think my hard drives have both crashed since they don't show in bios. It could also be a problem with the sada connectors on the motherboard.
Turn off, unplug. Check your connections, ensure fans, vents, heatsinks are clean.
When you power on, enter CMOS/BIOS/UEFI setup and check your settings.
I have managed to get the os in safe mode. What should i do next? When i went to desktop the screen went black
I would uninstall the video driver in safe mode. If you have an nVidia card, use DDU to uninstall it. If something else, you could look for a comparable utility. Restart after that as normal; you should have the default VGA driver and Windows should find the current driver for you and install it--let this happen and restart when it tells you or when everything is settled. You should be good to go.
If it doesn't install a video driver for you, download and install the latest driver and restart afterwards.