From this thread.
If you have a cast iron pan you need to get cleaned up and reseasoned, for my money, the best way to go is the oven cleaner in a plastic bag method, which involves covering the pan in lye-based oven cleaner and putting it in a plastic bag overnight.
It may take a few days, but that will get the nasty gunk off nice and easily. Just wash the cleaner off every night and apply a fresh coat before rebagging. I cleaned a nice skillet down to fresh metal that way. You may need to do a little scrubbing, but not much.
Then, you want to remove any rust, and the best way to do that is to soak it in a solution of water and vinegar for a few hours, and then rinse with just water. The pan should be thoroughly dried in a hot oven before applying your first coat of seasoning.
Your best bet for seasoning is a thin coat of a drying oil like fresh flaxseed oil or soybean oil. Canola also works, but sometimes creates a harder, more brittle coating. My preference is soybean oil; flaxseed oil is expensive, difficult to find, and goes rancid very quickly if not properly stored.
You’ll want to do several coats, ideally at least three, before you start cooking in it. The best way is to heat the oven to 500F and when heated place the pan in it, covered in a thin coating of oil. Leave it upside down so the oil doesn’t pool. You should leave it in there for an hour on full heat, and then turn the oven off and allow it to cool.
You should see an instant shiny coating – repeat as many times as appropriate, at least three. If the coating isn’t immediately black, don’t worry – it may turn a very dark brown, which is entirely normal, and this will become black with repeated applications and cooking.
Also, the things you cook in it will affect the seasoning – don’t do anything with a lot of sugar in it, or tomatoes, or anything which requires a lot of boiling. There is no surer way to f*ck up new seasoning than the above.
You should do lots of things involving frying at first; skillets are very good for this, obviously, and they are very good for making cornbread with a super crunchy crust, especially if you preheat oil in them and pour the batter into that before baking.