My father bought this hat for me.

Literal

Father [topic-は] me [for-のために] this hat [object-を] bought [for me-てくれた].

ためにand てくれた double up on the benefactive meaning — 'for my sake' + 'as a favor to me.' In natural speech, one or the other usually suffices.