Smoke detector requirements come from two places: the NEC covers the wiring (Article 760 for fire alarm circuits), and the IRC/IBC covers the placement and interconnection requirements. For residential: hardwired with battery backup in all sleeping rooms, outside each sleeping area, and on each level (including basement). They must be interconnected - when one goes, they all go.
The NEC wiring for interconnected hardwired smokes: typically run on a dedicated 120V circuit. The interconnect wire is a low-voltage signal wire - usually a third conductor in addition to hot and neutral. If you’re replacing smokes, match the brand or use a known-compatible replacement because the interconnect protocols aren’t universal - Kidde and BRK smokes don’t interconnect with each other in most cases.
CO detectors are required in new construction in most states where there are fuel-burning appliances or an attached garage. The specific requirements vary by state. If you’re doing a kitchen remodel or adding a fireplace, check whether your permit triggers a CO detector requirement. I’ve had inspectors fail rough-in because a CO detector wasn’t installed.