because I didn’t know what to doUsually follows an indirect question, such as what to do or say; the specific question comes before this phrase. The subject is often omitted.
JA: 何を言えばよいか分からなかったので、彼に相談した。
EN: Because I didn’t know what to say, I asked him for advice.