couldn't go, couldn't (do something)Negative past potential form of 行く; the context determines whether it means being unable to go or being unable to do something.
JA: きのうは学校にいけなかった。
EN: I couldn't go to school yesterday.
had toIn the expression ~なければいけなかった or ~なきゃいけなかった, it means that something was necessary.