Mouth ulcers usually go away by themselves after a week or so, so you’ll need to avoid aggravating the area until then.
We’d recommend avoiding spicy, rough, or very hot or cold foods until your mouth ulcer has passed.