She was at a complete loss for what to do.

Literal

She [topic-は] [what to do-どうしたらよいか] at-a-loss-fell.

どうしたらよいか is built on the conditional ~たら ('if/when one does') plus よい/いい ('good'): literally 'if (one) does how, would (it) be good?' — 'what should be done?' The question-particle か embeds the whole thing as a complement clause feeding into 途方に暮れる ('to be at a loss'). 途方に暮れる is itself a vivid set phrase: 途方 ('way, course') + に + 暮れる ('grow dark / fall into evening'), evoking a traveler caught out at dusk with no path forward. Outside this idiom 途方 rarely appears.