We prove that any space X with a dense Čech-complete subspace is cofinally pseudocomplete, i.e., if \(f:X\rightarrow M\) is a continuous onto map of X onto a second countable space M, then there exist continuous onto maps \(g:X\rightarrow P\) and \(h:P\rightarrow M\) such that \(f=h\circ g\) while P is second countable and has a dense Polish subspace. We show that \(C_p(X)\) is cofinally pseudocomplete if and only if it is pseudocomplete and \(C_p(X,[0,1])\) is cofinally pseudocomplete if and only it is pseudocompact. We introduce, in an analogous way, the class of cofinally locally compact spaces and show that \(C_p(X)\) is cofinally locally compact if and only if X is finite. Besides, any locally countably compact GO space of countable extent is cofinally locally compact and hence cofinally Polish. Our results solve several published open questions.