I always liked to use a working example, when I was learning. Then make lateral modifications to get what my goal was. That way, all the bits are there for the particular language and compiler and run-time environment. As soon as it broke, then the last change I made is where the error is.
My first C language experience was negative, because the compiler sucked. In theory it was supposed to ignore white space, but it didn't. So I removed all the white space, then put it all back in. Probably couldn't tell a single space from a one-space tab ;-)