You have two unknowns here, red and blue cars. I'd call them "r" and "b" just to be simple. You need to use the info given to make two equations with these variables and then solve them.

For the first statement, you know that the total of the red and blue cars was 30. So in math terms you can say . The second one is trickier. How can you write "after selling 2 red cars and no blue cars, the dealer had 3 times as many red cars as blue cars" into an equation?