A small forward bow (15°) is the default greeting. Don't initiate handshakes unless a local extends one first.
The depth of the bow signals respect — 15° for casual, 30° for formal, 45° for deep apology or gratitude. As a foreigner, 15° works for almost everything.
Don't try to bow and shake hands simultaneously. Pick one. If a Japanese person offers their hand (common in business), shake gently and add a slight nod.