Link can make his way to one of the particular hunting grounds of the Molduga to kill the beast without even entering Gerudo Town. But, it is also a good idea to undertake the Medicinal Molduga side quest first to gain the advantages of killing the beast.
By starting the Medicinal Molduga side quest, move first toward Gerudo Town located on the southwest corner of Hyrule, and then into Riju's Mansion. After that, back out from the exit to the right to finally reach the courtyard full of training soldiers. From there, Link meets Malena while shouting commands to all the training soldiers.
Malena will then request Molduga guts from Link and will give him a task to take down the beast roaming the Gerudo Desert settled all throughout the town. Go back to Gerudo Town after that, and go to the west to be in the middle of the Toruma Dunes that is a fairly vast sub-area of the Gerudo Desert. Even though Molduga appears to be a fearsome opponent, it can be taken down easily by utilizing Remote Bomb function correctly, and Link will become prepared with a good amount of melee weapons.
However, Molduga can sense Link through movement. So sprint immediately to the rocky outpost in the battlefield when the fight begins and climb to the rock. When already prepared, throw a Remote Bomb nearby, and wait for the Molduga to sense it. If the Molduga has erupted from underground and the Remote Bomb near its mouth, immediately detonate the bomb causing it to fall and remain motionless for about fifteen seconds.
While the Molduga is still motionless, Link must paraglide off the rocky outcrop to go down near the beast. Give it some precious few hits and then retreat to the rocks when the Molduga started to pick itself back up off the ground. Keep on repeating the tactic because the Molduga has no way to prevent it until it will eventually be down.
Pick up the Molduga guts when it is already dead. Finally, go back Gerudo Town to claim 300 Rupees from Malena for the item.