Make sure your detector runs on batteries and is not just hard-wired to the electricity in your home.
Take the top off the detector and follow the manufacturer's instructions for changing the batteries.
Replace the whole detector if it is a detector that runs on a 10-year lithium battery.