You can do this problem 2 ways. Whichever works easier for you:
Take the cost of 8 apples and divide it by 8 in order to find a per apple cost
4/8 = $.50 per apple
Then multiply the total number of apples by the cost per apple
12 * $.50 = $6.00 paid
Or
You can divide the total number of apples by 8 to find how many units of apples you have
12/8 = 1.5
Then multiply the number of units by the cost for 1 unit (8 apples)
1.5*$4 = $6.00