The first thing you should do is stop moving at somebody else's pace.
Stop it. You will get tired if you try to match someone moving faster than you.
Instead, you should understand where are you stuck, what did you decide when you first began and now where are you? What is slowing you down?
Answering a few questions about your present situation, and then move on to what you wish to do now - do you want to learn a concept more, make a project? What do you want to do?
Take up any small goal and then get started.
The act of starting small will give you back the confidence lost. Then begin to keep doing smaller things, every day.
Slowly pick up and take up 2-3 more things to do every day. Increase your load of work slowly and keep it doable. And now when you are confident enough, take a leap and do even bigger things.
The only thing that will keep your confidence in your abilities is clarity in your actions. What to do, how to do, will keep you down and you will feel like not starting at all. To stop this, don't move according to somebody's pace, become aware of your position and define your own finish lane and line and turn up every day to walk, jump, and run on it.
If you do that, come rain - come sunshine, you should be fine.