Melt butter in a large skillet (preferably cast iron) over medium-high heat. Add corn kernels and cook, stirring occasionally, until cooked through and slightly charred, about 8-10 minutes. Add the garlic the last 2 minutes of cooking.
Allow corn to cool slightly. Stir in mayonnaise, chili powder, cotija cheese, lime juice, and chopped cilantro. Season to taste with salt.
Serve warm or cold. Store leftovers in an airtight container in the refrigerator.