means "go to the trouble of", "all the way": the action took effort, time or a journey that wasn't strictly needed. It is an adverb and goes in front of the verb, in casual and polite speech alike.
。
Thanks for coming all this way.
きごう?
You went to the trouble of making this for me?
、。
Thank you for taking the time to come when you're so busy.
With a favour – , – わざわざ thanks someone for the effort.
"Didn't need to bother"
The same word can say the effort was wasted or odd. With or it means "you didn't need to", and in a question it means "why bother?".
。
You didn't have to go to the trouble of calling.
きごう?
Why go all the way to a shop that far away?
わざわざ or せっかく
わざわざ looks at the effort someone made. looks at what that effort or chance should lead to, and is usually followed by "so it would be a shame to…" or "but…".
。
He came all the way to the station to pick me up.
、。
Since you've come all this way, stay a while.
わざわざ or わざと
means "on purpose", usually about something unkind. Thanking someone with it accuses them instead.
- × わざと来てくれてありがとう → わざわざ来てくれてありがとう