I have a vent in the ceiling that no longer stays in place. I think it is drilled into dry wall but the drywall is too corroded to keep the vent in place. Any suggestions on how to fix this? Do I just use ordinary spackle? It seems like a simple job.
Yes, any spackle will fix that. Carefully check the metal vent box and you should find some screw holes for the vent. From the picture it looks like there might be a double drywall installation and the screws don't reach into the metal vent box. If that's the case, get some longer screws from your home store.
To start it's always best to screw into a ceiling joist if you can. Even if it's only one side that will give you your best support for the vent. In the pic it looks as if there might be at least one along the edge of the drywall.
On the sides with no joist you need hollow wall anchors. screws won't hold in drywall unless you use them. So if you need to screw into the drywall alone pick up some spackle at your local hardware store and patch the screw holes that are there. Work the spackle up into each screw hole and then smooth it over with a putty knife and let it dry. Your hardware store will also have hollow wall anchors. Pictured below are a few different types but there are others as well. The vent cover won't be very heavy so you won't need anything too substantial. For your situation I like the auger type best. When you screw them in try to place them away from the edge as much as possible so you won't break down the drywall edge.
As JACK indicated long screws into the metal vent box if you can do that is another good way to secure it. But if you can't then use hollow wall anchors.