I'm Japanese and don't know well about the English idiom "to be out of it." But I think I know some useful Japanese words for your situations.
「頭が働かない」
This expression is natural to say when you have a cold, fever or other bad condition and can't understand or think about things well temporary. "I'm sorry I have a cold so I'm a bit out of it." could be
「すみません、[風邪]{かぜ}が[悪化]{あっか}しまして、[今日]{きょう}は[少々]{しょうしょう}[頭]{あたま}が[働]{はたら}いてないときがあるかもしれません。」
in Japanese polite conversation. Without [敬語]{けいご},
「ごめんね、[風邪]{かぜ}で[今]{いま}ちょっと[頭]{あたま}が[働]{はたら}いてないかも」
「ぼんやり」「ぼんやりしがち」
ぼんやり means almost same as ぼうっと in the sentence ぼうっとする. The difference is that we can use ぼんやり in more various situations than ぼうっと or ぼーっと. ぼんやり is not a perfect formal word, and can be both polite and casual ways of saying to anyone. 「[最近]{さいきん}なんだかぼーっとしてる」or 「最近なんとなくぼーっとしてる」 sounds like you do so because you like to do so. If you say
「最近なんだかぼーっとしちゃう(casual)」
or
「最近なんだかぼーっとしてしまう(casual)」,
Japanese people think it happens whether you like or not.
「最近なんだかぼんやりしがち」
has the same meaning. With "a little",
「最近なんだかちょっとぼんやりしがち」
or
「最近なんだかちょっとぼーっとしちゃう」
is natural to say.
「最近なんだか[少]{すこ}しぼんやりしがちなんです」
is a [敬語]{けいご} version.
「頭がまわらない」
When I really need to use my brain but it doesn't work, I say 「[頭]{あたま}がまわらない」. This is one of common expressions in Japanese language. If 頭がまわらない, people can't be productive or energetic.
「いっぱいいっぱい」
This is frequently used in everyday conversation in Japan. いっぱいいっぱい means that you have things to do more than you can manage, and your overworked brain seems to be able to accept no more input. So your situation could be described like this
「[週末]{しゅうまつ}、[忙]{いそが}し[過]{す}ぎて、いっぱいいっぱいになってました」.
いっぱいいっぱい sounds like a childish word but actually everyone uses this; kids, women, men, seniors, really everyone in Japan. This is not a perfect formal word but we can use いっぱいいっぱい in [敬語]{けいご} conversation. Of course, in casual conversation too. When we want emphasize this, we say
「もういっぱいいっぱい」「かなりいっぱいいっぱい」etc.
If I were you, I would say
「[忙]{いそが}し[過]{す}ぎて[本当]{ほんとう}いっぱいいっぱいになってて、週末、頭ちゃんとまわってなかったみたい。ごめんね、あの[答]{こた}え、もう[一回]{いっかい}、[教]{おし}えてもらっていい? お[願]{ねが}い!(casual)」
to someone whose answer I've forgotten. The 敬語 version is
「すみません。週末いろいろといっぱいいっぱいの[状態]{じょうたい}で、ちょっと[記憶]{きおく}のはっきりしない[部分]{ぶぶん}がありまして……本当にすみません、もう[一度]{いちど}だけ、あのことをお[伺]{うかが}いしてもいいですか?」
I guess that in everyday conversation, 「ぼうっと」, 「ぼんやり」 or 「[頭]{あたま}が[働]{はたら}かない」 has the closest meaning to "to be out of it". But other words might be better to use in some cases.
Other words examples:
「へろへろ」「へろへろ[気味]{ぎみ}」「[思考]{しこう}[停止]{ていし}[状態]{じょうたい}」 etc.