The Bay Bridge decides your pier
Yokohama Bay Bridge is the reason the biggest ships end up at Daikoku. The city describes Daikoku as the terminal for mega-ships up to 220,000 tons that cannot pass under the bridge, so if your ship is one of the large modern ones, assume Daikoku until told otherwise. From there the nearest stations, Motomachi-Chukagai or Shin-Koyasu, are about 15 minutes away by taxi.
There is also a third Yokohama berth that itineraries rarely name: Shinko Pier, a single 340m berth inside a building with shops, restaurants and a hotel lobby. It is a 10-minute walk to Bashamichi Station and 12 minutes to Minatomirai Station, so it is nearly as convenient as Osanbashi.
Flying in for embarkation
Haneda is the easy airport. Yokohama's city figures put Osanbashi about 30 minutes from Haneda and Daikoku about 20. Japan's national tourism board lists the Airport Limousine Bus from Haneda to Osanbashi in roughly 40 minutes for 720 yen, or the Keikyu train to Yokohama Station plus the Minatomirai Line to Nihon-odori takes about 36 minutes for 660 yen, with a 5-minute walk from the station to the pier.
Narita is a different proposition - about 90 minutes to Yokohama whichever way you go. The Narita Express to Yokohama Station is listed at 4,090 yen one way. With an international flight into Narita, a hotel night in Yokohama or Tokyo before sailing removes most of the risk.
From Tokyo hotels, a shared shuttle (operated by Green Tomato) runs to the port on selected dates only, at 6,800 yen per person, and has to be booked ahead.
Sources: city.yokohama.lg.jp, japan.travel