How was the step size determined to be h=1/18?
The author of the code wanted it to be 1/18.
What does Euler's method in the while sling actually do?
It computes the derivative at the current point by evaluating f() and approximates the curve by going a step in this direction as a straight line.
And from where did the f1 function come from, what does it calculate?
If you mean f(), this function was chosen by the author of the code. All we know as readers is the formula. We cannot have the faintest idea if this is the price of bananas or the trajectory of a ball on a curved surface.
Furthur, how can the accuracy order be determined from this?
A simple investigation is to reduce the stepsize h and compare the resulting trajectory. In numerical maths you learn a lot about the accuracy of the Euler method.