.
Your setup equation is correct.
Wording is not perfect and can confuse you.
The cost of the pizza is $18.
Judy ate x part of the pizza.
Tom ate (2/3)x part of the pizza.
An equation is (2/3)x + x = 18.
To de-confuse, I would use another wording.
The cost of the pizza is $18.
Judy ates x part of the pizza and pays x part of $18.
Tom ates (2/3)x part of the pizza and pays (2/3)x part of $18.
The money equation is (2/3)x + x = 18 dollars.
Now, to complete the solution, you should solve the equation
and find the values x and 2x in dollars and cents.
Boldly go forward.
Ignore their hint - it is IRRELEVANT to the problem and to the solution.
By the way, what is the name and who is the author of this textbook you refer on?