The Crown of Madness spell only lasts a minute, but other types of madness can endure. Lesser Restoration handles short- or long-term madness, while Greater Restoration works for indefinite madness. Remove Curse can work as well, depending on the specifics