Hi @anands13732
Check that there is 19V DC at the output plug of the charger.
If the charger is OK it may be a faulty [https://www.amazon.com.au/Charging-Replacement-A515-51-A515-51G-50-GP4N2-003/dp/B087BWZP3Z|DC-In jack] (supplier example only to show what the part looks like)
Sometimes the centre +ve pin of the DC-In jack, breaks internally and this opens the power circuit from the charger to the motherboard, preventing the laptop from being turned on using the charger and also the laptop battery from being charged.
Here's a [https://www.youtube.com/watch?v=6RrrXGqJw5Q|video] that shows how to replace the jack.
You can test the jack first to see if it is OK by disconnecting the jack cable from the motherboard and then testing the jack for continuity with an Ohmmeter, from the jack input to the red and black wires on the plug of the cable connected to the jack. Alternatively, disconnect the jack cable from the motherboard, plug the charger into the jack and then check if there's 19V DC between the red and black wires of the jack cable.
If the jack is faulty it will have to be replaced as it cannot be repaired.
Search online for ''Acer Aspire A515-51G DC-In jack'' to find suppliers that suit you best.
If the charger and the DC-In jack are both OK there's a problem on the motherboard and further testing using the schematics would be required to find out what's wrong.