Question about the derivative definition
Solution 1:
Instead of $h$ here I will use $\Delta x$ as I think it makes more sense to consider a change in $x$.
For $$\lim\limits_{\Delta x\to 0} \frac{f(x+\Delta x) - f(x)}{\Delta x}\tag{1}$$ at no point do we ever substitute $\Delta x=0$. We can only say that in the limit $\Delta x$ tends to zero; this is why there is the limit notation directly in-front of the fraction.
Consider the graph below which is an identical graphical representation of Equation $(1)$:
You can see from the graph that the Secant line, which is the line that intersects the purple curve at $(x,f(x))$ and at $(x+\Delta x,f(x+\Delta x))$ is an approximation to the derivative (tangent) of the purple curve at $(x,f(x))$.
Now imagine $\Delta x$ getting smaller and smaller until eventually it becomes vanishingly small; which we call 'infinitesimal' (loosely speaking this is as small as you can possibly get but still greater than zero).
At this point you can see that the Secant line approaches the Tangent line or derivative at $(x,f(x))$ as $\Delta x$ tends to zero. Thus, the approximation of the Secant line to the Tangent line is optimal at $(x,f(x)+\Delta x)$ and this is the exact meaning of Equation $(1)$.
Solution 2:
You seem to conflate the two notions of "take the limit as $h$ approaches $0$" and "plug in $0$ for $h$". In some situations, the latter is an easy way of doing the former. But in other situations, including the definition of derivative, the latter is (as you noticed) nonsense, and so you have to actually do the former. (The first step toward doing the former is, of course, to make sure you thoroughly understand the concept of limit.)