Contact an American or British tour company. Persian Voyages and Serious Traveler offer tours that include two days in Hamadan. The tour involves a flight to Tehran followed by transportation by tour bus to various cities including Hamadan.
Make sure your passport is up to date.
Check with your medical provider to ensure you are current on all immunizations.
Ask your tour director which type of currency will be most useful to have on hand. Get some money exchanged into currency to use for tipping and purchases.
Read up on stories based in Hamadan. Read the poetry of Baba Tahir who was born in Hamadan in the 11th century as you prepare to visit his mausoleum. Learn the story of Queen Esther before you go to her tomb to make your experience more meaningful. Mathematicians will be interested in the thinking of Ibn Sina (or Avicenna), the mathematician who died there about 1,000 years ago. You can read his autobiography, which includes ideas as well as actions.
Plan to wear floor-length dresses or skirts and a head scarf if you are a woman. Pack long slacks if you are a man. Foreigners are not exempt from Iran's strict rules about conservative dress.