An informal expression used when one is worried or unsure what to do. Often continues as 'どうしようか' to suggest considering options.
時計を忘れてしまった。どうしよう、授業に遅れる!
I forgot my watch. What should I do? I'm going to be late for class!
明日のプレゼンの資料がまだできていない。どうしようか。
I haven't finished the presentation materials for tomorrow. What should I do?
財布を落としたみたいで、どうしようとパニックになった。
It seems I lost my wallet; I panicked, wondering what to do.
友達が急に泣き出して、どうしようと声をかけられなかった。
My friend suddenly started crying and I didn't know what to do, so I couldn't say anything.