Ricardo had to start with 16 golf balls.
Step-by-step explanation
First we will assume that the number of golf balls in starting was
He lost 6 golf balls while playing yesterday, that means remaining number of the balls
Today he bought 12 golf balls , so now the number of balls
Then he lost 4 balls on the course today, so the remaining number of balls
The question says that he now has 18 golf balls, that means...
So, Ricardo had to start with 16 golf balls.