If my pokemon is confused and I flip a coin to attack and get heads will it
be confused or not confused any more?
Thank you

Flipping heads will allow that attack to successfully work, but will not end that Pokemon's confusion.  Once confused, they stay so until they faint, evolve, are benched, or are Full Healed.

Scott