This is thoroughly discussed in the book Artificial Intelligence - A Modern Approach
There are also excellent implementations available (this is java, there is also python, you can Google for more) based on the book series. Including for tic-tac-toe (and alpha-beta pruning agents).
If you're using the min-max algorithm with alpha-beta prunning, you can use a sorted "Actions" list to perform better in addition to your heuristic function (a trivial utility-function would be assigning 1 to a victory, 0 to a tie and -1 to a loss - these are all leaf nodes of the min-max expanded tree).
To sort the actions you can, for say, prefer actions that add your symbol(X, O) to a clear-to-victory path. This should eventually lead to better prunning.