A running total grows as it goes down the column, each row adding to the sum of everything above it. The trick is one locked reference and one that moves.
The formula
=SUM($B$2:B2) in column C
What each part does
$B$2
The fixed start of the range. The dollar signs hold it on row 2, so as you fill the formula down this end never moves.
B2
The end of the range, with no dollar signs, so it moves. On row 2 the range is B2:B2; on row 5 it has grown to B2:B5. That growing range is what makes the total build up.
How it works, and what to watch for
The first reference is pinned with dollar signs so it always starts at the top. The second is left free, so it stretches further down with every row.
That mix of locked and loose references is the whole idea behind the dollar sign, and this is the clearest place to see it at work.
If every row shows the same number, the anchor has come loose. Check that the start of the range still has its dollar signs.
Questions
What do the dollar signs actually do?
They pin part of a reference so it does not shift when you fill the formula down. $B$2 stays put; B2 moves. A running total needs one of each.
Is there a newer way to do this?
On Microsoft 365 you can use SCAN, but the classic SUM with a locked start works everywhere and is easier to read at a glance.
Set by your computer's language, not by the file. A frequent cause of a correct-looking formula being rejected.
Excel version
XLOOKUP, IFS, TEXTBEFORE and TEXTJOIN need Microsoft 365 or 2021; older versions return #NAME? instead. Choosing the older one switches every walkthrough to a formula that works there.