First you have to know what's causing it.
A common cause is a microscopic worm (i know: gross!) that your doctor can identify by examining a sample under a microscope. Other causes include various bacterial or fungal species. Treatment is then prescribed for the specific cause. The many otc anal itch creams are mostly a waste of money as they do nothing to remove the cause.