Normally, fighting the tarrasque is silly. Either the party needs to be of epic level, or the battle will be a hilariously one-sided affair. It also might be reasonable to assume that your party will never be of a high enough level to challenge the tarrasque on equal footing, because, after all, very few parties reach very high level. Moreover, battling the tarrasque with high level characters might remove a lot of its potential as a monster, since what the tarrasque best represents a deadly, insurmountable challenge. If it can be easily defeated in a conventional fight, it doesn't really accomplish that.
Other features, like armies, powerful outsider allies, or artifact weapons might help to turn the battle in the party's favor, but this isn't a perfect solution either, since the contributions of magic items or NPCs can threaten to overshadow the efforts of the player characters. And no matter what allies the PCs might have, battling a monster like the tarrasque carries heavy risk of party death -- it's a CR 30 encounter, after all.
Prevent its Awakening
There are, of course, other ways of presenting monsters that doesn't involve fighting them. One of the most common ways of doing this is by framing the powerful monster as a looming threat that might be unleashed. This means another villain, like some madman that wants to unleash the sleeping tarrasque, can act as a proxy for the monster itself.
This approach has pros and cons. One advantage is that is frees you up to do a more conventional campaign with manageable villains and an overarching plot. One major disadvantage is that the broad strokes of this plot have been done to death and 'madman that want to release Ultimate Evil' isn't what I would call inspired material. That being said, any tired trope can be revived with a little bit of creativity. You have a very different plot if, for example, the madman is actually completely sane, but possessed of a spirit that inhabits his body at night and seeks to reawaken an ultimate evil for revenge.
Lastly, it should be mentioned that if the tarrasque is awakened, it provides the players with an alternative to killing it: putting it back to sleep. You can do this with a variety of McGuffins, from ancient rituals, to artifacts, to divine intervention, but the end result is narratively the same: the tarrasque returns to its ancient slumber (for now.)
One more alternative for the classic battle scenario is simply to put the player characters in a position of damage control. What do you do when the big bad tarrasque is loose in the city, and there's nothing you can do to stop it? A smart person would run, but player characters are heroic by definition, and would probably be more likely to stay in the city to rescue as many people as possible from the rampage. This represents a chance for the party to do some real good in the campaign world, outside of merely self-serving quests, and offers an opportunity for the players to get more creative with their character's abilities. Spellcasters get a chance to demonstrate their flexibility, and martial types can show off their toughness and daring.
At the end of the day, this approach is several positives, but doesn’t actually do anything to confront the threat directly. Sometimes you don't have to in order to craft a unique and engaging campaign session. Keep these alternative approaches in mind next time you want the tarrasque, or another colossal monster of your choice, to stop around your campaign world.