This isn't a surefire way to win tic-tac-toe, but it's one I've been using for years and has rarely failed me. It helps significantly if you go first, but you can make it work either way if you keep an eye on your opponent.
For your first move, mark one corner. For your next move, mark the opposite corner (if your first move was top right, your next move should be bottom left) then for your last move, mark one of the remaining corners. This leaves you with two routes to win by connecting either corner to the adjacent one that you've marked. When your opponent tries to block you, simply mark the other one and congrats! You've just one tic-tac-toe.