Every loan payment is part interest on the balance and part principal that reduces it. Early on most of the payment is interest; by the end it's mostly principal.
IPMT(rate, per, nper, pv): the interest in payment number per.
PPMT(rate, per, nper, pv): the principal in that payment. IPMT plus PPMT equals PMT.
CUMIPMT(rate, nper, pv, start, end, type): total interest from payment start to end. All six arguments are required; type is 0 for payments at the end of each period.
In a schedule, lock the inputs with $ and let per come from the month column, so one row of formulas fills down. The balance column starts at the loan and subtracts each month's principal.