Hi Allan, often the township website will have info on the CO requirements. Generally there is an application, a fee, and an inspection. Some towns are stricter than others - my advice - follow the instructions carefully and test everything to be sure it is working order - ie, smoke and carbon monoxide detectors. If you fail, you'll have to reschedule which could cause a delay and likely involve a second fee.
As Laura mentioned, generally securing the CO is for the seller to do, but in a short sale and/or foreclosure, it is left for the buyer to do. But to close, it must be done. Once completed, get your certificate of approval to your attorney.
"Unwavering Commitment to Service"
Find success at http://www.feenick.com