You can't see all of Edinburgh in a day, but you can absolutely see the best of it. The city's headline sights are stacked into a compact, walkable core, and the whole thing tilts downhill from the Castle, so with one early start and a single sensible route you'll cover the Castle, the Royal Mile, a world-class museum, and the finest skyline view in Scotland without ever needing a bus.
This is the day I'd walk. Coffee on Cockburn Street before the Castle opens, two hours inside it, then down the Royal Mile to St Giles' and the buried streets of Mary King's Close. A pulled-pork roll on Victoria Street, an afternoon in the (free) National Museum of Scotland, a scone on Market Street, sunset on Calton Hill and a haddock supper at the bottom of it. Nine stops, roughly 7-9 km, all on foot, top to bottom.
A few honest warnings: Edinburgh is hilly and the Old Town is cobbled, so wear shoes with grip. Pack a waterproof whatever the forecast says. And book your Castle ticket in advance, because that one queue is the only thing that can throw the timing off. If you've got longer, the 2-day itinerary adds Arthur's Seat and Holyrood, the 3-day adds the New Town and Dean Village, and the 5-day stretches out to Stockbridge, Leith and Portobello.