For me when learning a new programming language, I find that I move through three important phases. First I'm copying what other people are doing and consulting books and manuals constantly for everything I do. After a while I'm consulting other things I've done myself and imitating those. Then finally I get to where I'm not consulting anything and the code is just flowing, often with my own interesting twists.
Incidentally, feeling like it's too hard for you and that you're not smart enough just goes with the territory. Also try to ignore the temptation to feel like it is all very easy for everyone else. I find that the feeling of failure is often its worst right before I make a breakthrough. After about the fifth time of thinking this is too hard for me, I can't do it, then doing it, I realized this is a pattern for me and learned to ignore the feeling of it being too hard.