Start with clean cast iron.. Once the pot pan or what have you is down to bare metal apply a thin coat of oil fat etc. (I recommend flax seed for its ability to polymerize). Wipe off so it’s almost unnoticeable (the opposite of a drippy mess which creates pools). Then heat your oven to 500 or as close as your oven can get to 500 then leave the over on for 1 hour. At the end of 1 hour turn off the oven and let it cool (don’t open oven door). In about 3 hours when you can touch the pot with your hands without being burned you are ready to repeat. Most people recommend at least 6 layers which leaves a rich brown color if you went to bare metal and used flax seed.
What ever you do just don’t season a dirty pan. I see people do this on YouTube I guess be cause they don’t want to put in the effort or don’t know how to really clean the pan.