Here is an Apple article for troubleshooting charging issues:
If your MagSafe cable or power adapter isn't working - Apple Support
If none of those things help, then there is some sort of hardware issue with the laptop. Many of the internal components could be causing the problem or may be due to a combination of them (Battery, I/O Board, I/O Flex Cable, Logic Board). Accidental liquid damage is another very common cause as well (it really doesn't take much to cause a problem and most of the liquid damage I have seen on these tends to hit the power & charging components).
You would need to find an experienced repair tech to figure out which components are at fault along with having known good test components. There is a slim chance this laptop may still be supported by Apple as long as the necessary parts are still available since it was discontinued in 2019 with repairs until 2024 & possibly as late as 2026, but this model is not shown on the "Vintage" or "Obsolete" hardware list:
Obtaining service for your Apple product after an expired warranty - Apple Support
The question becomes, is it worth spending money on such an old system and such a low end underspecced system which can only run up to macOS 12.x Monterey? It makes more sense to put the money you would spend on repairs towards another laptop.