25 points for grabs!

I have 1 bag of marbles. I put in 3 extra marbles. There are now 9 marbles in the bag. How many were in the bag to begin with?

Look I very obviously know that the answer is 6, however I would like the working out and just an explanation on how to do it. Please and thank you <3