This is a common issue on the L505D that happens from a capacitor breaking off of the motherboard. The easiest way to fix it is to replace the motherboard. [https://www.youtube.com/watch?v=D2_-iSbG0_4|This video] shows how to actually repair the motherboard via soldering, but I don’t recommend anyone without much soldering experience to follow this guide.
Unfortunately, the motherboards for the L505D, at present time, are rather rare and expensive, so I would simply replace the laptop as a whole.