Thanks to a friend's kindness, I was able to get a job.

Literal

Friend [possessive-の] goodwill [by means of-で] job [to-に] attach [potential-ことができた].

好意 (こうい, 'goodwill, kindness') names the enabling factor — で marks it as the means or cause. 職に就く ('to attach to a job') is the formal way to say 'to get a position.' ~ことができた is the formal potential past.