Answer:
The system of equations is

x is the number of small boxes
y is the number of large boxes
That system solves to (x,y) = (4,2)
In other words, x = 4 and y = 2
=========================================================
Work Shown:
x = number of small boxes
y = number of large boxes
x+y = 6 total boxes
y = 6-x after subtracting x from both sides
----------
10x = number of bars from the small boxes only
30y = number of bars from the large boxes only
10x+30y = total number of bars
10x+30y = 100
10x+30(6-x) = 100
10x+180-30x = 100
-20x = 100-180
-20x = -80
x = -80/(-20)
x = 4 small boxes were purchased
y = 6-x = 6-4 = 2 large boxes were purchased
----------
Check:
If you bought x = 4 small boxes, then that gives 10x = 10*4 = 40 granola bars so far. Then y = 2 large boxes gives another 30y = 30*2 = 60 granola bars. That's 40+60 = 100 total, which confirms the answers.