Ghee is clarified butter. The milk solids and water have been removed by gentle cooking. It is Sattvic and balancing for Vata, Pitta and Kapha when taken in appropriate quantity and at appropriate times. Clarified butter keeps well at room temperature, but can be refrigerated.
While you can buy ghee, it's easy and much less expensive to make your own. All you need is unsalted butter. The best ghee is made from European-style cultured butter rather than the common butter made with lactic acid. The only cultured butter I can find locally is the Irish import, Kerrygold.
You’ll get a feeling for how long this will take after you’ve done it once or twice. On my stove it takes 3-4 hours, and most of that time is spent in getting to the boiling point. If you’re in a hurry, start with medium heat and turn to low once the butter begins to boil. But be careful – you can get explosive spattering of hot butter when the water starts to boil. Once boiling begins you’ll likely have somewhere between 15 and 30 minutes to go.
If you don’t go long enough, you’ll leave some water at the bottom, which you’ll likely notice as a separate brownish layer when you pour off into the jars. That’s not really a problem as long as you don’t get it in the jar. Even if you do, the water will settle to the bottom. This will just make it more likely for a thin layer of rancidity to occur there.
Conversely, if you neglect the ghee and it cooks too long after all the water has evaporated, the temperature will rise very high. The milk solids will burn. The ghee will turn black and take on an awful taste—a true disaster. Fortunately, all is not lost. You can clarify it with milk. Curds, like fresh cheese or plain yogurt, creamed with a liberal amount of water work as well or better. Strain the ghee into a clean saucepan, add the milk or curd mxture, and boil for about 5 minutes with a few cardamom pods. Skim the solids on top and strain into a clean bowl. Once it cools, refrigerate for at least 6 hours. Then cut out a wedge of ghee so you can pour off the water which will be otherwise trapped underneath. You'll find brown residue on the bottom of the ghee that can be scrapped off and discarded. Put the solid ghee back into a clean saucepan and boil for a few minutes. By then, it should be clear enough to strain into jars. If not, repeat the clarifying process. Here's a video with subtitles demonstrating the process: https://www.youtube.com/watch?v=ICqH6X0bn30
Ghee can substitute for butter or oil for general purpose cooking, but not necessarily for baking. It will give baked goods a dense, oily texture. Definitely try it for carrot cake.