Suppose you construct the complete tree of possible plays.
Evaluate terminal states as (+1,0,-1)
Evaluate non-terminal states as maximum/minimum of children evaluations for player X/O respectively.
This propagation of evaluations is called minimax.
Consider minimax on a subtree of possible tic-tac-toe plays