You already saw the model guess, measure its loss, and nudge its weights downhill. This is the missing piece: how it works out which way is downhill for millions of weights at once — by passing the blame backward through the network.
First the network runs forward to make a guess. Then the error at the very end is passed back through it — and every weight gets a share of the blame for how wrong the guess was.
The blame on one weight is just a slope: if I nudge this weight up a hair, does the loss go up or down, and how fast? Collect that slope for every weight and you have the gradient. Here it's two weights, so the loss is a bowl.
Now put it together. Each step moves the weights a little way downhill — a fraction of the gradient, set by the learning rate. Do it again and again and the ball rolls to the bottom of the bowl.
Plain gradient descent takes the same fixed step everywhere — slow in flat spots, jumpy on steep walls. Next, optimizers: how tricks like momentum and per-weight learning rates (Adam) make the ball roll to the bottom far faster.