Someone please help me, write a variable equation to represent the situation, and solve it by using inverse operations.

Three times the difference between a number and six is eighteen.