For some people, being approached by a co-worker with a request is viewed as an inconvenience, especially when that requests asks a lot of our time or focus. Maybe the co-worker doesn’t have a good understanding of what exactly you do, or what you’re responsible for, yet the they come to you with the hopes of you solving their problem.
If you want to provide a better interaction with those co-workers, immediately give yourself this goal when the interaction begins:
Help this person.
Avoid the temptation to defer them on somebody else unless that person would be better able to serve them. Avoid making excuses for why you can’t help. Take off the headphones, step away from the keyboard, and give them your attention, even if it’s for a brief moment. Do what you can to make their situation a bit better.
Sometimes, the most productive move for your career is to improve the career of others.