If the battery looks warped and gets noticeably hot while charging, it needs to be replaced. That's a no brainer and it cannot be salvaged or worked around. It's kaput.
If the battery is fine, but when you pick up the phone and it feels slightly warm, even though you haven't used it, then it's probably running something when it shouldn't be running. This can be caused by a lot of different things, and can be solved from anything from clearing your cache (this, often solves it), doing a malware/virus scan, all the way to factory resets and data wipes. And what is using the power isn't always apparent via battery usage/monitoring apps, so i wouldn't even bother going that route. And even though it may solve the problem, it may come back, for no apparent, traceable reason - because over time there are updates and we add or remove apps when we use our phone, and we don't know what things are changed and left alone.
Personally, i've tried so many things and some measures have worked but problems come back and persist, to varying degrees. The only sure way that i have done that gives me result is to use the Greenify app and use shallow hibernation and aggressive doze, along with not keeping wifi on during sleep (only when plugged). This ensures that, when i'm not actually using the phone, all processes (apart from core/critical) and any data is completely shut down and thereby the power that is used toward that end is cut off. If i have light use, i can have a charge for as long as 4-5 days at a time, which sounds incredible, but with the screen off most of the time and no background, rogue processes, it's possible. And the app allows you to whitelist apps, so you still get notifications and such (if you keep wifi on or plugged in).
But for this to really work well, you need to have your phone rooted and Greenify working in root, with Usage Access. Also note that this aspect of the app requires you to be on Android 6 or higher. It's a good idea to root your phone since you want to be able to get rid of bloatware that is probably draining a lot of your juice in the first place. But you may have some luck using the app without root or not at Android 6. Try it - who knows.
But do try clearing your cache first (in settings->storage). That may resolve it and you may not need to go further.
Anyway to sum up, ROOT, Greenify, shallow/aggressive doze. Hope that helps.