?
Either way is fine; they’re both acceptable (but certain style guides may have their preference.)
It depends on what you’re trying to say. if you “cannot” do something, it means you’re not capable of doing it; if you “can not” do something, it means you are able to refrain from doing it.
So, if you were allergic to alcohol, you might say “I cannot drink alcohol”. If you were volunteering to be a designated driver, you could say “I can not drink”.
*Is it cannot or can not? *
Yes.
*Is it cannot or can not? *
Yes.