You multiply the number 8 to each term in the parentheses.
8 x 5g = 40g; 8 x 5 = 40; 8 x (-2) = -16
Combine these together and it would be 40g + 40 - 16
The Distributive Properties establishes that . This property connect the operations of sum a multiplication. If we have more term as the same property holds. That is to say,
The dot means multiplication. In your case you have a expression of this last form. So applying this distributive property we have: