All you lack is lots of practice. Programming is hard but gets easier the more your practice.
And I mean practice on some project that you are personally interested in completing, some genuine goal, not an exercise or theoretical. /academic challenge.