It's like any language - whether code or a spoken language. You have to learn the basics first . In Game Maker (if you can find a copy) start using the old GM 5, 6, 7 or 8 drag and drop "building blocks" and see what the code is for those basic events - then as you progress you may refer to the manual to extend your knowledge. Personally, when I needed to find something I found it in the manual, eventually. It is a good idea to read through it just to see what functions etc there are and what they do.
That's what I did but haven't used Game Maker in over 10 years thus, I have forgotten all the code. I have just looked at some old games I was trying to write over 10 years ago and, to be honest, I haven't a clue how I managed to write it. I got lost trying to understand everything. So, it is also very useful to have comments in your code reminding you exactly where the code is activated and what the results of the code do or go to.