Your drill needs to be dismantled and the problem discovered.
Know that these modern tools are not always repairable, but you can at least try.
One reason for the last sentence is parts are not readily
available, particularly if they are made in China.
God bless your efforts.
From your description the battery is probably faulty. If the batteries are still quite young it is possibly just one cell and while Ryobi don't refurbish batteries there are companies dotted around that do.
If it is a nicad battery, Ryobi told me just a couple of days ago they no longer supply nicad replacements and expect everyone to upgrade to lithium, which means also buying a charger.
they are for the charger to know the voltage in the battery to turn on or off charging. some just need 3 connections and the 4th is just a dead connection. or can be for location only so you don't put the wrong battery in. as they do other voltage batteries that look the same fitting.
Green light indicates fully charged. If not the case then unplug hold trigger in on position to drain all components then while holding the trigger in on position plug the charger in. If this fails it will need repair.