If it is a canker sore, consider changing your toothpaste to one which does not contain Sodium Lauryl Sulfate. It's a compound which makes it foam.
I use a product from Rembrandt brand which is made specifically for people who get canker sores. No SLS, and has some other stuff in it.
It doesn't foam up when you brush so it requires more effort to clean your teeth, but it seems to have reduced the frequency of sores forming.