As soon as possible to the vet as Marigold says Roadrk, as these things can cause permanent lung damage very quickly -we found out the hard way.
Then look for the cause. No good treating a bird if the cause isn't established and rectified. Poor ventillation or damp or dusty bedding are the probable causes. We had one that got an infection from mould spores growing on a plywood roof. Caused by poor ventillation I add. We couldn't improve the ventillation but did bleach then gloss paint the roof and that sorted it.