Tic tac toe

sorry for double posting

Im making a game of tic tac toe or naughts and crosses

3x3 squares

how do i make it so if u click the square it turns 2 a circle

then if u make a line you win

and the “computer” tries to stop you by making red squares then u cant click them

also could i make a reset button so u start again.

thanks in advance,
yhack