===================================================
Explanation:
Initially there are 15+18+12 = 45 marbles total. He selects 3 marbles (2 reds, 1 blue).
Assuming he doesn't put the three marbles back, this means there are now 45-3 = 42 marbles overall. The yellow count hasn't changed since the first three marbles do not involve yellow. We have 12 yellow out of 42 which leads to the fraction 12/42 to represent the probability of getting yellow.
Reduce 12/42 to get 2/7. You divide both parts by the GCF 6.
-------
Side note: if he did put the marbles back, then the probability of getting yellow would be 12/45 = 4/15