Ulcer is a broad term. Particularly, in the mouth, ulcers need to be evaluated for the reasons for the problem. If it is simple ulcer, like aphthous ulcer, it will be healed by itself. Some times, we give anaesthetic ointments for the same. But if it is something like infected (viral or fungal), need to be treated with anti viral or anti fungal drugs. So, first the cause for the ulcer need to be evaluated. If cause is treated, ulcer will be healed. Fortunately, most of the ulcers in mouth heals well with proper treatment after understanding the cause.
Next Steps
Visit a dentist or oral pathologist