Simply write code and learn the hard way. I can tell you from experience that copy and pasting does not bode well with the learning process.
You have to make a significant effort in order to learn how code works in different scenarios.
Anyone can take Google Translate and talk to a Chinese person in a broken, poorly translated language. But to learn Chinese (programming) as an actual language requires commitment and determination.
Once you get over this hurdle, the rest should be much easier to manage and understand.