Program language doesn't make sense! Book to learn?

I didn't think about YouTube tutorials. I'll definitely look into that. It's not one particular section of code I'm having trouble with, though. It's that going through these projects, I'm just copying the examples. I'm not picking up on it. After inputting one line, I can't really guess what the next one will say. I thought going through the examples would basically teach me, but it's not making much sense to me.