See if the onboard diagnostic offers a clue, restart your system and press the ***D*** key to enter [https://support.apple.com/en-us/102603|Mac startup key combinations]
I would install this gem of an App [https://www.coconut-flavour.com/coconutbattery/|CoconutBattery] depending on your OS you may need to email them to get the older version.
What’s important is the battery has a lifespan, you may need to replace it. Review this Apple TN [https://support.apple.com/en-us/HT201585|Determine battery cycle count for Mac laptops]
Let us know what you discover as you need to dig a bit to know which pathway you need to go.