Mood swings - my husband only has a few months left but he was so nasty to me today, calling me stupid. It can be so hurtful, I don't know what to do

My husband has only got a few short months left and today he was so nasty to me because i left lights on and plugs in calling me stupid I’m shattered I’m disabled myself I now he angry about it but he can be so hurtful I’m drained don’t now what to do