There are a number of approaches you can take, depending on the specific campaign.
1. Remember that many places don't have an alarm to hit. A lot of interesting targets will not have an alarm to hit, or will only have a very basic one that requires some human to trigger it manually. Many places will not have one due to cost and complacency. Others, especially in a cloak-and-dagger type game, will not have one precisely because they have something to keep secret and will not have or do anything that can betray what is going on inside or attract outside attention. And of course if it is something along the lines of a "panic button", then all the PCs have to do is either avoid detection by humans or take the person down before they can hit the button. That type of alarm will make the stakes of being detected higher, but not change any fundamentals.
2. Preparation As lorimer mentioned, dealing with the alarm can be part of the game. If the PCs know to expect an alarm they can find some gadget (in sci-fi) or spell or amulet (in fantasty) that lets them get past it. Or they can find some way to disable it ahead of time. Or they can use social engineering to avoid the issues (of course the gaurds will politely turn off the alarm for the nice repairman, people can be bribed to disable them, etc).
3. Does the alarm actually matter? Sometimes an alarm can go off and it just doesn't matter, besides adding flavor. If, say, the alarm just calls out to normal law enforcement the response time could be measured in several minutes (possibly more if there is a big event tying up law enforcement's attention or this is a dystopian future where law enforcement is stretched past the breaking point...) The PCs might be able to ignore the alarm, do their thing, and get out before the cavalry arrives, the alarm just adds some urgency.
Even better, if the PCs have enough information, they might be able to use the alarms to their advantage. If the PCs have one team deliberately trip an alarm somewhere, it just might pull security away from their actual target while they go in. Even if they unintentionally trip a second alarm, they might have some time and face a reduced security response because of the first alarm.