In the game of tic-tac-toe there is no strategy by which you can always win. But there is an interesting strategy by which you can win most of your matches when playing the first move and the worst case scenario would be a draw. Just remember the following things while playing.
1. Start with a corner square.
Lets take the corner square to be bottom-left one
2. Now if your opponent plays any move except center square.
The best thing about this strategy is that now, if your opponent plays any move except the center piece, you are guaranteed a win.
If your opponent plays at top-right corner (corner opposite to the one you played in general):
i. Play your next move at any of the remaining corners say top-left corner (as shown)
Notice that your opponent will be forced to play on a particular edge square ( like the left edge in the figure shown below) to stop you from winning
ii.Then play at the remaining corner square,which will create a fork case where you can win in two different ways (but playing the center square or the bottom edge square) but your opponent can block only one of these squares.
If your opponent plays at top-left corner (an adjacent corner):
i. Play your next move at the remaining corner, notice that again your opponent will be forced to play on a particular edge square to stop you from winning
ii.Then play at the remaining corner square,which will create a fork case similar to the above case.
If your opponent plays any of the edges(top,left,right,bottom):
i. Play your next move in such a way that you force your opponent to form an L shape with your occupied squares (notice that there is only one way to form an L shape after playing one one move each), choose a corner adjacent (top right in our case), again our opponent will be forced to play his next move so as to stop you from winning
ii.Then play at the remaining corner square,which will create a fork case where we can win by playing our next move on any of our diagonals.
3. Now if your opponent plays at the center square.
i.Your best chance of winning is when you play the opposite diagonal
ii.If you opponent plays at any of the corners squares then you can play at the other corner square left and get a case where you can win by two ways and your opponent can block only one of the squares
The only way the game can end in a draw is when your opponent plays an edge square after the center square. Here you should try to block your opponent to take a win by blocking his winning squares. And the game can go somewhat like this.
I hope this will help you win at tic-tac-toe games obviously against someone who doesn't know this trick otherwise the games will keep on ending with a draw.