Tons of great advice in this thread. I was in Japan for 3 weeks last summer. I haven’t read everything here, but one thing I want to mention is that depending where you’re currently living, and when in the summer you’re going, you might not be aware of how hot and humid it can get there. July/Aug can be extremely sweat-inducing.
Tokyo is absolutely incredible and offers anything you might be interested in. I highly suggest doing research into the things you like and creating daily plans where you know your path and can hit up the places you want to see. It’s such a huge city that until you’re been there a few times, you probably don’t want to spend your time aimlessly wandering as it’s easy for a first timer to get lost and disappointed when they can’t find what they’re looking for.
In terms of customs, I feel Japanese people don’t expect foreigners to understand all of their societal norms, however I would say to pay attention to how people around you are acting. If everyone is wearing a mask, wear one as well. If the place you’re in (this counts especially for trains) seems quiet, then don’t be the loud foreigner.
Also (not sure if this came up already) but there was a time when it was more rare for many establishments, especially restaurants, to accept credit cards. This has changed a bit, but still have cash on hand since you may find yourself in many situations where that’s the only form of payment accepted.
Be present and enjoy! Regardless of where I find myself in Japan, whether it’s a tiny town or huge metropolitan area, I find it extremely relaxing every time and I never feel like I’m anywhere except Japan. It is so different and wonderful, especially if you’re from a Western country.