A freshly initialized neural network makes essentially random predictions. 'Training' is the process of adjusting its millions of parameters, little by little, so its predictions get closer to correct. The tool that decides which direction to nudge each parameter is called gradient descent.
The loss: a single number for 'how wrong'
A loss function compresses the entire gap between prediction and truth into one number. Training is nothing more than repeatedly asking: 'if I nudge each parameter slightly, does the loss go up or down?' and moving in the direction that decreases it.
Forward pass
compute prediction
Compute loss
how wrong was it?
Backward pass
compute gradients
Update weights
step downhill