After you make your way through Mushroom Way, you find the Hammer Bros. holding Toad hostage.
Battle the Hammer Bros.
Mario's Jump attack is more powerful against the Hammer Bros. than his regular attacks. The Hammer Bros. will sometimes use the special attack "Hammer Time", where they throw a lot of hammers at you. You can press the attack button after all hammers have hit Mario's head and the last hammer is pointing straight down to reduce the damage. When one Hammer Bro is defeated, the other will use Valor Up, which will reduce the damage that it takes from Mario's attacks.
If you level up, you can choose a level up bonus. You can preview which stat will increase, and how much it will increase, before you make your final choice. It is helpful to pick the bonus that gives you the biggest increase in points.
Afterward, there will be a cutscene, and you will get a Hammer. Be sure to open the menu and choose Equip, and equip the Hammer as your weapon.
In the Nintendo Switch version, you also get a Flower Jar, which you can use right now to permanently increase your FP by 3.
Then go northeast to reach the Mushroom Kingdom.