“Sorry, I got sidetracked.”
Someone asked you a question earlier in the day at work. You were supposed to find the answer, but you forgot because you were doing other things. The person calls you to ask again, and this is how you explain.
Sorry, I got sidetracked.
"Sorry" is a way to apologize for a small mistake you made. When you make a larger mistake and want to apologize more strongly, you can say "I'm sorry for ___ing":
I'm sorry for calling you by mistake.
However, in most situations this would be much too strong of an apology. So just saying "Sorry" is sometimes more appropriate:
Sorry I didn't call you back sooner.
When you "get sidetracked" it means that you were trying to do one thing, but then started doing something else instead:
I was trying to cook dinner but I got a little sidetracked.
You can say that you "got sidetracked" by something more important than the original action, or by something that's not important at all.