Update: After looking around and thinking what the problem might be, it occurred to my uncle (big thanks to him) that the laptop might be overheating. A simple idea that completely flew over my head. I removed the CPU fan and what do you know, a LOT of dust. There was almost a sponge like structure the dust had formed and that was completely blocking the fan from spreading the heat. Cleaned it out and it works wonderfully now. Managed to run diagnostics on everything, and it is all good. Fix: Check if the laptop is overheating. A good place to look is the CPU fan and in some cases It might even be that the thermal paste of the CPU. Both of these things can cause the laptop to overheat, in my case it was the CPU fan, cleaned out some dust from it and it works perfectly fine now. Thank you for the help and I hope this discussion helps someone with the similar problem!
Background: A couple of days ago one of my family members powered off our Dell Inspiron 5720 laptop normally. The following day the laptop would not power on at all, it seemed like the battery was dead. We thought it was the battery until we saw that the charging port inside the laptop was wiggly but the power light was on. We had that repaired, and the power still showed it was charging. The laptop would still not turn on, after some reading we thought it might be a static charge problem so we followed the instructions to remove the battery and charger, hold the power button for 20 seconds and test it out for both the battery and charger one by one. Here it was really interesting because the laptop started to boot, the dell logo showed but immediately after reaching the boot menu (we have Windows 10 and Ubuntu 20.04 dual boot) it powered off and would not turn on again with the power button unless we repeated the whole static charge procedure again. I opened the back of the laptop and proceeded to try to turn on the laptop without the hard drive, it would give the expected beeps that the HDD is missing, but it would still power off almost immediately after pressing the power on button. I proceeded to test out each of the RAM sticks thinking it might be that, but the same kept happening. Today I opened the laptop completely gaining access to the whole motherboard. I removed the CMOS battery for about 30 minutes hoping for it to make a BIOS reset, and it did; Surprisingly after this reset when I put back the charger and powered it on it proceeded to load the boot menu and let me select an option. I selected ubuntu, it started the booting process, but shortly after it powered off again. This time however it did allow me to power it on with the power button, but each time I did so the amount of time the laptop would stay on was shortening. I proceeded to do another BIOS reset  repeating the steps I did before for another 30 minutes. This time I selected windows and it booted up completely, however after only 2 or 3 minutes of using Windows the same thing happened. The laptop powered off and each time powering it from the power button, the time the laptop stayed on shortened. Now, again, it powers off almost immediately after hitting the power on button; Barely reaching the boot menu. I should also mention that the blue screen with the CPU information showed up a couple of times but it always powered off immediately after reaching it.   TL;DR: Every time I hit the power button on my Dell Inspiron 5720, it shows my (Ubuntu 20.04 and Windows 10) boot menu and it powers off completely. It does not load any operating system, but just powers itself off after reaching the boot menu screen.I'm guessing it is a hardware issue. I guess I can try to boot from an external drive, but as I understand the laptop powers itself up to prevent unwanted harm to the hardware, I'm guessing it must be a hardware issue;   What can cause this kind of an issue? And more importantly, how do I fix it?
Dell Inspiron 5720 powers off imidiately after reaching power menu