This guide shows how to remove the battery from the Ryobi P271 drill to charge it or replace it.
If the battery is not working a possible underlying cause may be the battery is not charging so the power drill will not turn on. Additionally, the battery isn't pushed in all the way. Make sure you properly center the battery then push it in enough for you to hear a click. If the battery is in all the way and the drill still won’t power on, you may need to purchase a new battery.
Another possible underlying cause is the battery doesn't maintain power. If you already ensured that the battery is properly inserted and the drill still doesn't work, try putting the same battery on another drill to be certain that the problem is with the drill and not the battery itself. If the battery doesn’t work on another drill it is safe to say it is dead and a new one will need to be purchased. You can check on this guide for more details about getting a new battery.
If the problem is internal you will be required to open up the battery itself by removing the screws. From there, look for loose of broken wiring. Anything that may look unnatural to the battery may be the cause of your problem.
Detach the battery unit from the drill body by pressing the battery release buttons on both sides of the unit and pulling outwards.