Except for the citizens of Egypt, Georgia, Bolivia, Azerbaijan, Turkey, Lebanon, and Syria, the rest must obtain a visa to enter Iran. Obtaining Iran visa is not difficult and its first stage can be performed through online websites (like this). There are only a few limitations and details that we suggest you take a little time and complete your information before obtaining the visa. For example, Israeli citizens cannot travel to Iran. If you have ever gone to Israel, you cannot obtain Iran visa.
If you are an American, British, or Canadian citizen, you should travel to Iran on a tour. Moreover, there is a series of other details that we suggest to read the article on the Iran visa on the site. We explained everything there.