For some, being approached by a co-worker with a request is inconvenient, especially when they request our time or focus.
Maybe the co-worker doesn't have a good understanding of what you do or what you're responsible for, yet they come to you hoping you'll solve their problem.
If you want to provide a better interaction with those co-workers, set this goal for yourself:
Help this person.
Avoid deferring them to somebody else unless that person can better 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 be helpful.
Sometimes, the most productive move for your career is to improve the career of others.