Whilst I haven't played Magic in a while, use of the stack was something that I always found a little confusing. When I first started out, our group could tap an opponents attacking creature after attackers had been declared and effectively take it out of combat? Is this right? Or did we have the stack order backwards?
This is not so much about the stack, as the order of the turn:
After the main phase, there's a step where you can play abilities like tapping, but before they can attack you: Beginning of Combat step. Every turn goes in this order (with minor exceptions) But when we play, we usually don't bother talking about every phase and step, often because nothing happened in them! But they're still part of every turn, if we need to do something then.
So there's nothing wrong with your opponent playing a spell, then moving right on to "I attack you with this guy." All you have to say is "wait, I want to do stuff at the Beginning of Combat" and back up to that point. Then you tap whoever you want to tap. Just remember, after the tapping your opponent gets to decide how they want to attack, knowing their creature is tapped!
And after they know you can tap things, in future turns they should stop and ask you before they declare attackers. (You can ask them nicely to do this.) That way they don't give away the info of who they want to attack with!
Once attackers have been declared, tapping them usually has no effect, but there are exceptions.
Suppose a creature with Vigilance has been declared as an attacker. You can surely tap it, and perhaps gain an advantage thereby (e.g. being able to attack next turn without it being able to block); it just won't remove the creature from combat.
A little confusingly, if a creature is regenerated mid-combat, it is both tapped AND removed from combat. But the removal from combat is a property of regeneration, not a property of becoming tapped.
Spells, activated abilities, and triggered abilities go onto the stack when they are cast, activated, or triggered. Before they resolve, any player is allowed to play other (instant-speed) spells or abilities, which themselves go on the stack and can be responded to. If no player responds to an item on the stack, the top (most recently played) spell or ability resolves.
There are, however, several actions that do not use the stack. Among them are the turn-based actions, the game actions that happen automatically when steps or phases begin or end. Declaring attackers is one of those turn-based actions: As soon as the "Declare Attackers" step begins, the attacking player declares any attacking creatures, before anyone gets to play any spells or abilities that step. This action cannot be responded to; once a creature is declared as an attacker, you cannot tap it to prevent it from attacking. Even if it has vigilance, tapping it will not remove it from combat unless it's due to regeneration or an effect that explicitly removes something from combat.
However, there are occasions before the Declare Attackers step when opponents are allowed to tap potential attackers; in particular, the end of the pre-combat main phase, and the end of the "beginning of combat" step. For convenience, most players respect "In response to your declaration to attack" as shorthand for playing something at the end of the main phase. Note, however, that the attacker is not obligated to declare attackers before such a response, and is free to change any declaration that was proposed before you interrupted it.
For example, if your opponent plays Arc Runner and immediately declares it as an attacker, you may play Twitch on that Arc Runner "in response," by which you really mean at the end of his or her pre-combat main phase. However, if you do, your opponent is then allowed to attack with any other creatures he or she controls. On the other hand, if you specifically ask which creatures your opponent is attacking with, you have implicitly given up the ability to play Twitch until after they're attacking.
As for tapping a creature to remove it from combat, something similar used to apply to blockers, not attackers. That rule was removed in the sixth edition rules update, when the stack was introduced.