In a small saucepan, melt the butter, stirring a bit to help it out, over medium heat.
The butter will become foamy then bubbly. Once bubbly, turn the heat down to low or medium low and allow to simmer. Do not stir for the remaining of the process.
The butter will reach a second foamy stage and the milk solids will separate by floating to the top and sinking to the bottom. The liquid portion will become transparent and it will steam a bit as all the water from the butter evaporates.
If you stop at this point, you have clarified butter.
To achieve ghee, continue cooking until the milk solid sediment at the bottom of the pan darkens a bit and a nutty scent emits from the pan. Be careful not to overcook and burn it.
Once the clarified butter or ghee stage is achieved, remove from the heat and allow to cool for about 4 or 5 minutes.
Place 3 or 4 layers of cheesecloth over the mouth of a mason jar (I like to loosely screw on the mason jar's ring to hold the cheesecloth steady). Slowly pour the ghee/clarified butter through the cheesecloth and into the jar; the milk solids will get caught on the cheesecloth. Skimming is not necessary, but you're welcome to do so if you wish.
Remove the milk solids and enjoy the ghee or clarified butter!