[verb (dict form)] + ついでに [verb (た form)] + ついでに
[noun] + の + ついでに
ついでに is used to express doing something while you're at it – taking advantage of an occasion or action already happening to do something additional. The nuance is that the secondary action is done conveniently alongside the main action, rather than being the primary purpose.
It often translates to "while you're at it," "on the way," "incidentally," or "taking the opportunity to."
ついでに connects two actions where the first action creates a convenient opportunity for the second.
ついでに can attach to different forms:
Verb (dictionary form) + ついでに – when the main action hasn't happened yet
Verb (た-form) + ついでに – when the main action has already happened or is being described as completed
Noun + の + ついでに – using a noun to describe the occasion
The action after ついでに should be something secondary or incidental – not the main purpose. If both actions are equally important, ついでに sounds unnatural.
ついでに is relatively casual and is used in everyday conversation. It can sometimes sound dismissive if used about something the listener considers important, so be mindful of context.