Generally, power banks will work for 2 to 3 years only. It will work for about 500 to 1000 charges only. As per your statement, it is 2 years old. Probably the life might have been over. Anyhow try to do the following.
If the problem is in charging the power bank you can check for the following,
1. Cross check the charger you are using with any other device and confirm that it is working properly. If it is not working, you may have to change that.
2. See the charging port condition. If any dust or similar materials accumulated means, you have to clean the same once.
3. Try to use the original charger. In the market, we are getting many duplicate and cheap chargers. They will spoil the device also.
If the problem is while the power bank is charging the other device, you check for the following
1. Check the charging cable and port and ensure that they are working properly. Otherwise, change the charger and clean the port.
2. Before using the same try to see that the charger is having a minimum charge. If the charge is very less. it may not work properly.
3. Some power banks may not work if the device that is getting charged is fully charged. In such a case, the power bank may get switched off.
4. If there is any loose contact, the power bank will get heated up and get disconnected.
After checking all the points also if the power bank is not working properly show it to a technician who knows the mechanism completely. Never try to open the power bank on your own unless otherwise, you know the complete mechanism of the system. The mechanic will see that same and suggest you accordingly.