Something no-one else has mentioned yet is learning methods. Stuff might not be sticking because you're using the wrong learning method for you. Instead of reading a book, maybe watch a video tutorial instead, learn by doing etc, get a mentor to pair program with?
Also look up 'imposter syndrome', it does sound a lot like you're suffering from self-esteem issues too so maybe get someone to talk with?