Adding alcohol to your dishes is not just for the flair (and flare), it serves practical purposes too. When used in cooking, alcohol can add flavour and complexity by bonding with fat and water molecules, which helps it carry flavours and aromas throughout the dish. Alcohol can be used in marinades, poaching liquids, making pan sauces, and desserts. The most common way that alcohol is used in cooking is in deglazing, as it adds a depth of flavour to a dish that would not ordinarily be there.
Contrary to conventional wisdom, cooking with alcohol doesn't completely "cook off" the alcohol in most cases. The amount of alcohol that's cooked off or retained depends on the type of alcohol used, how long it's been cooked for, and the cooking method. Studies have been done to test the amount of alcohol left in food after cooking.
Also, when cooking with alcohol, be careful not to set the bottle too close to the flame or cooking element, and avoid pouring the alcohol straight from the bottle (by pouring only what you need into a separate bowl or glass first) to protect against any flare-ups from catching up from the stream and into the bottle.
The cardinal rule of cooking with alcohol is to never use something that you wouldn't drink. This does not mean use your most expensive stuff, though, as delicate flavours can be lost in the cooking process.