For the PM and boss: "to attend to this new task, I'll have to postpone these other tasks which you asked me to do. Which one is more important?" + paper trail + "this week we focused on Y and are pushing X one week" in status reports.
For the peers and subordinates: if the request is legitimate, discuss, brainstorm, "Here's how I'd approach finding a solution, try it and check in when you find a few possibilities. Google and SO are your friends."
And, for subordinates: teach them to think for themselves and to lead
https://m.youtube.com/watch?v=psAXMqxwol8
Of course sometimes you'll have to put out a fire. But if it's a small fire then you should be training your firemen on it.