Since there are two unknowns, we need two equations.
H = # hamburgers sold
C = # cheeseburgers sold
H + C = 508
C = H + 58
H + (H + 58) = 508
2H + 58 = 508
2H = 450
H = 225
C = 225 + 58 = 283
So 225 hamburgers and 283 cheeseburgers were sold.