Average cost of a commodity is simply the total cost of production of n units divided by the number of units, i.e. 'n'. In other words, it is the cost of production of one unit.
Marginal cost of a commodity is the cost of production of an incremental unit.
Average cost is also defined as the sum of average fixed cost and average variable cost.
If fixed cost is represented as FC, variable cost as VC, total cost as TC and the number of quantities produced as Q,
then average cost, AC = TC/Q = (FC+VC)/Q
whereas, Marginal cost, MC = change in VC/change in Q (or incremental cost)
For example, if 4 phones are produced at a cost of $100 and 5 phones are produced at $130,
then average cost = $100/4 = $25
and marginal cost = $130-$100 = $30.
Hope this helps.