Take your ears of corn and chop off the top part with the silk. If needed, trim the bottom section so that your corn fits in the air fryer.
Remove any loose outer leaves of the husk (very important, so they don't blow and catch on fire). Run the corn under water briefly.
Place corn in the air fryer basket and cook at 400 degrees F for 20-25 minutes. (Check after 15 minutes to remove any additional loose parts of the husk).
Remove from air fryer basket, remove the husk and any silk and coat with butter and season as desired.
Notes
It's very important to remove some of the loose husk pieces before air frying. When air frying, they can loosen up and fly into the air fryer fan and burn. I recommend removing some to start, checking around the 15 minute mark to see if any have loosened more and remove any that have. And keep an eye on your corn! You can also place something on top of the corn to prevent this.
You can also wet the ears a bit before placing in the air fryer, and this will allow for steaming and help keep the husks from drying out as much.