Two days is enough to see the best of Edinburgh without rushing, as long as you're smart about geography. The essentials, the Castle, the Royal Mile, the National Museum, a whisky tasting, Holyroodhouse, and both of the city's great viewpoints, are all packed into a compact, walkable core that tilts downhill from the Castle. Plan a sensible line through it and you'll never need a bus.
This is how I'd split it. Day 1 is the Old Town, top to bottom: Edinburgh Castle first thing, then the Royal Mile, an underground tour beneath the street, and the (free) National Museum. Day 2 walks the whole length of the Mile from a whisky start down to the Palace of Holyroodhouse, climbs Arthur's Seat for the big view, and ends with sunset on Calton Hill. Roughly 6-8 km a day, all on foot.
Book two things ahead: your Edinburgh Castle morning slot and your Real Mary King's Close tour, both of which sell out and both of which anchor Day 1. Everything else flexes around the weather, and it will change on you, so pack layers and a waterproof regardless of the forecast. That's why a free indoor museum sits at the end of Day 1.
Only have a single day? Our one-day Edinburgh itinerary covers the must-sees in one walk. Got a third day? The 3-day itinerary adds the New Town, Dean Village, and the Botanics.