There are many causes of painful anus when passing motion, and I agree that an anal fissure is a rather high possibility.
To answer your question, anal fissures are usually treated with a topical ointment (the one I prescribe in my clinic is Proctosedyl, although i have heard of some other doctors preferring Rectogesic. On top of that, you will need to keep your stools soft, so as to avoid additional trauma when you pass motion. Sometimes I will have to give a stool softening agent (like Lactulose syrup) to soften the stools.
Usually the fissure will heal in 1-2 weeks' time, and the pain should stop. If your anal pain persists beyond that, do see a doctor (your family doctor will be a good start) for a proper anal and rectal examination to look for other causes.
Rarely, some very persistent and difficult to treat anal fissures will need surgery. Your doctor will discuss with you further should you need it.