I couldn't go out because of illness.

Literal

Illness [because-のため] I [topic-は] couldn't-go-out.

外出できなかった — 外出する means 'to go out.' A simple application of the のため + potential negative pattern.