よいか分からなかったので

because I didn’t know what to do

→ 良い
phrase Rare #34,485
because I didn’t know what to do Usually 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.