The Santa Sophia Basilica, built in the 6th century, was converted into a mosque when Constantinople fell to the Ottomans. It became the famous Hagia Sophia Museum it now is in 1934.
My suggestion:
For a better understanding of the place and to get the most out of the visit, find about its history beforehand or take your own guide with you, as there is not much information available once inside.
Summary:
I found myself stunned by the magnificence of the Hagia Sophia, which is located in the Sultanahmet district. The building is particularly famous for its mosaics and its incredibly varied architecture. Nevertheless, I was a bit disappointed with my visit, mainly because of the lack of detailed information about what you're seeing. I also found I wasn't able to enjoy the atmosphere of the place, perhaps due to the crowds of tourists there at the time. For the same price, I preferred visiting Topkapi Palace, which is just by the side of Hagia Sophia. There are some veritable treasures to be seen amongst the collections they have there.