When trying to do physics on a more general pseudo-Riemannian manifold we want to require that there is a foliation of this manifold into three-dimensional subspaces. By this I mean we would like to have a way of splitting our spacetime $M$ into a part that we call space and one we call time. This is necessary, for example, in order to write the two-form $F$ that represents the electromagnetic field as $F = E \wedge dt + B$. I know that this is possible if we assume $M$ to be compact, but this implies that there are closed time-like geodesics (I have been told I would not know a proof). What are the necessary and sufficient conditions for such a foliation to exist? I would also appreciate it if you could inform me about books/resources that go into these sorts of questions. I have looked into books about GR, but they don't seem to talk about these sorts of things.