Both "cannot" and "can not" are acceptable, although it's more common to see the one-word spelling--"cannot."
A quick and dirty memory tip is to think of a magician taunting a rabbit with a carrot saying, "You cannot have the carrot." Extend the r's in "carrot" to the bottom of the line and, voila, the "carrot" turns into a "cannot."
Get more tips like this in The Grammar Devotional:
Top People Cartoon Free Bunny Clothing Hat Magic from Pixabay.