For that particular item, look under the Arduino IDE: File/Examples/05. Control/ForLoopIteration
There are other good examples along the way.
For pulley/gear math, it rapidly gets into a combinatorial explosion of possibilities and there aren't ready-made examples. If you can already do the math on paper, translating it into C++ is sometimes straightforward. If you can't do the math on paper, not-quite-right code examples are probably going to confuse.
There is a built-in LED (L) on the UNO Board. Can you try to to find the Blink sketch from this path: IDE---> File---->Examples----->01.Basics---->Blink and upload it into UNO to continuously blink L?
After that modify the above program and upload the modified program to blink L only for 5 times at 2-sec interval. This exercise will serve you to observe how to repeat a process for x (here: x = 5) times.
I don't think you'll find any one place with little blox of code that you could then use to construct your… whatever.
Learn the programming language features, those are the parts you need to string together to make algorithms.
You could work through the examples in the IDE. They are designed to show off one or the other language element, how they works and what they are useful for.
As for dumb questions, no one likes to ask (or answer) them.
So ask smarter questions after you've finally convinced yourself you just can't understand after reading some code that maybe you googled and found in a project similar to what you'd like to be able to do.
Or after you've wired up some parts and borrowed or written some code that you can't get going, either because it doesn't compile, or when it doesn't do what you thought.
Don't just run example code - study it, read it line by line and stop yourself and use your friend google to try to come to an understanding of the step by step nature of how these tiny programs get their jobs done.
As for learning the language, the internets are full of options. Google and give 5 to 10 different tutorials or video series or whatever 5 to 10 minutes each, to find a match to your level of knowledge at this point and whether you like the style and pace of the material and, if there is one, the presenter.
Have you installed IDE 1.8.19 or later in your PC? If yes, then can you open the IDE/blank sketch (Fig-1) by clicking on the this icon : located on the Desktop of your PC?
Hey, just like bad content "out there," there is bad content "in here." You will be okay watching some videos to see their work. The two I mentioned are thorough (BVD3D walks you through start to finish) and entertaining. Have fun in your discoveries.
iv already watched a few BV3d vids and DroneBot. very interesting and informative.
I have to say. After my rough start when I 1st asked for help a few weeks ago now. I'm finding this forum a very pleasant place to ask question and help.