Loosing confidence and poor concentration can be due to overthinking/confusion/ any other emotional up down, try to find out cause behind this problem, you can share your problem with your best friend or family member or with psychologist
. You can use meditation
techniques to calm down mind and meditation to improve focus. As you hadn't mentioned your age so if it is due to aging or not that should be defined Don't loose hope and make clear other factors so I can guide you more in better way.