I will have 2 1/2 days to explore Istanbul on a layover to Italy. Is it important to order tickets in advance for attractions? Recommendations on what to do and see?
No need to book in advance (and at some sites you can't anyway).
Recommendations- depending on what you're interested in, the obvious ones are the Topkapi Palace (which I would say is a half day), the Sultanahmet Mosque, the Hagia Sofia, the Dolmabahce Palace and the Kariye Mosque. And the Basilica Cistern. Given your time is limited, you will need to limit what you see - perhaps Topkapi Palace, Sultanahmet Mosque and Hagia Sofia?
There's so much to do in Istanbul, so if you share your interests that would help. There is of course shopping, a Bosphorus cruise etc... but as noted you have a very short stay.
Not always the case for us, but we found the sites listing and the rankings in the Rick Steves Guidebook, matched fairly close to the way we would have ranked them. Topkapi palace took us most of the day. We lined up about 20 minutes before opening. Similar with the Hagia Sophia, I would line up about half an hour before opening. Go in and take all your pictures. Then go back to the beginning and read signs, listen to the audio, etc. I wouldn't recommend the virtual reality Hagia Sophia experience. Its pricey and IMO you don't have the time. Make sure you understand what line you are in.
I would also recommend the Blue Mosque, we went towards the end of the day, no wait. We visited a second time during the day and there was a short line.
Spend time in the evening in the pedestrian area around the Blue Mosque and the Hagia Sophia.
Chora Church/Kariye Mosque is lovely, especially if you like frescoes and mosaics. It does take some effort to get to. We took a cab.
If you like to shop (we don't so much), go to the Grand Bazaar and the Spice Market.
When I have limited time somewhere, I try to cover the sites that are unique to the city. For us, that was the mosques. We were very happy we got to the Mosque of Suleman and Rustem Pasa Mosque.
The view from the mosque of suleman is spectacular.
If you have time, maybe do the Basilica Cistern. Be aware that there is lines, and it costs more in the evening (no idea why) than during the day. It was interesting, but we thought expensive for the experience. We'd prioritize the mosques.
It was really hot when we were there. I'd recommend a lightweight dress that comes close to or covers the knees and a very light weight scarf for head and shoulders. If you don't love walking around in public places barefoot, make sure you have socks.
i'd recommend hiring a guide to make the best use of your time. we hired Metin Koca through a recommendation on this site. He will wait in line for you at the Hagia Sofia so you can get in at opening. Hagia Sofia, the blue Mosque and the. Basilica Cistern are all very close together. Topkapi palace gets very crowded so it's good to get there in the a.m. as well, so i'd do that on the 2nd day.
Also recommend visiting a Hammam/Turkish bath, and doing a food tour!
Just picking up on Jules's advice re dress, you should also really cover your arms down to your elbows if visiting a mosque, just out of respect. But worth noting many people don't.