People have covered most of the basics, but I will add, as someone who travels frequently in Japan and has for many years, that Westerners have a huge bubble of personal space/aura they carry around with them, which feels huge, inappropriate and pushy in Japan, though it is fine when they are at home. Be conscious of your psychic space and try to minimize it.
Japanese people carry around a much smaller bubble, but it is absolute. Even close friends bow and shake hands, though young women, and sometimes older ones, will walk with arms linked. Do. Not. Hug. Unless the Japanese person initiates it. This bubble is respected and honored. Give people lots of psychic space and psychic privacy. Living in crowded conditions means this Cone of Privacy is very important. Silence is golden. Speak softly. Text, don't talk. Don't wave your arms around. Manners are all that maintain civilization in crowds, I sometimes think.
Bowing is a big deal. You are not expected to know the nuances. Watch and learn. Bow a bit when shaking hands or meeting people, but don't make a big thing of it.
Shoe rules are huge. Watch carefully and follow them, as stated above. "Foot covers" can be found everywhere, and are rather like Peds, except they stay on well and are often lacy. They are frequently worn with pumps, summer shoes or sandals and are meant to show. I personally wouldn't go with Fast Flats -- they are too shoe-like for indoors to my eye. Tokyo at least is a very dressy city, and I have found Japan generally a dressy, fashion-conscious country. Jeans, T-shirts (unless high end designer with logos, as a fashion statement, and real shoes, not trainers) and trainers (only on the very young as a fashion statement or for sport) are just not done except for dog walking and the like. Khakis, European walking shoes and a Polo shirt, all very tidy, will carry your further. Japanese people are suckers for designer merchandise, and love anything with someone else's name on it. Make sure there's an alligator or a horse on that Polo.
Carry tissues, because sometimes there is not toilet paper (truth!) or you have to pay a machine for it, and said machine will be empty. Carry a handkerchief. This is your hand towel. You will need it. Tissue plus handkerchief is such a good idea, I carry them always, everywhere, now. A bandanna is OK. Bandannas make good gifts. IME, only men carry those washcloths, and then only when dressed casually.
In Temples and in Shrines, there is a dress code. Chest below collarbone, shoulders and arms to elbow, and legs to the knee covered are the standards. A mini with leggings (not tights) would be OK. These are houses of Practice (Buddhism doesn't analogize well) and people are there to do their practice or ceremony. Just as in an historic church in Europe, be conscious of this and respectful. There will be a front door, but it will not be used, generally. Look for the side door that everyone else is using. Take tours. They will be helpful.
After all of that, a very close Japanese friend told me once that if one is considered a well-mannered person in the US/UK etc., one will be considered well-mannered in Japan. Especially, again IME, if one learns and follows all the things people mentioned above, and don't ever be afraid to ask what is correct. People will be pleased at your concern and clue you in. The Japanese are great hosts, welcome visitors, love kids and animals, nature, and like to have fun. Enjoy!