Here's my step-by-step explanation:
@Jdoe0001 already gave you a hint in the comment section, and that's a real giveaway, but I'll expand on the hint.
Complimentary angles add up to 90°, and A and B are complimentary, then A+B = 90°. A proof.
Substitute. 42° + B = 90°.
B = 90° - 42°
B = 48°
Hope this helps!