Select your fog machine. There are different kinds that are more applicable to different situations.
If you are looking for a low-lying fog, as you would find in a graveyard or a marsh, use a dry ice machine. Dry ice is frozen blocks of CO2. It is extremely cold, and when hot water is poured on to it, it sublimates from solid to gas. The thick, rolling fog hugs the ground beautifully. If you want a generally misty look in the air, you need a hazer. Hazers are set on a timer to put fog in the air at regular intervals. These are common in nightclubs, as the lighting picks up the haze particles in the air and can make some interesting images. If you want to have directed bursts of smoke that you can control, or hide inside a closet or a container, use a smoke machine. Smoke machines have remotes that control the volume of smoke and the length of the blast.
Preheat before using. Smoke machines and hazers work by heating the fog fluid. If the machine is not warm enough, it will not be able to evaporate the fluid to create the smoke. Most fog machines will have an indicator light that turns on when it is ready to use, which is usually about 5-10 minutes. Dry ice machines take a lot longer to prep since they use gallons of hot water to melt the ice. These can make up to 4 hours of heating time. Some dry ice foggers are little more than converted oil drums on a hot plate. The dry ice is lowered into the tank of water when it is ready to go.
Load up your machine. Smoke machines and hazers use a brand specific fluid for their machines. If you use anything other than the specific brand of fluid for that machine, you could clog the machine and it can void any warranty you may have. Fill your machine's reservoir with the fluid, and be careful not to overfill. Dry ice fog machines need dry ice; this is found through specialized distributors. Web sites like DryIceDirectory.com, continentalcarbonic.com, and dryiceinfo.com can provide you with retailers near you. Dry ice needs to be kept cool before use. It will be fine in a portable beer or soda cooler until you need to use it.
Start your machine when ready. If you are using dry ice to fill a room, you will need a couple minutes after dropping your ice to get a decent coverage of your stage or party room. Do not do it too early, as the fog will dissipate quickly. Smoke machines are controlled with a remote control. The small and cheaper ones you can find at most party supply stores have a wired remote with a 6 to 10 foot long cord. This means your operator will need to stay near the machine. Machines that are more expensive will have wireless remotes, or even the capability to be controlled by a light board. However, these will come from a party rental company or a lighting effects rental company. You can set your smoke machine just about anywhere, so it can be set up near a doorway to frighten partygoers or inside a fireplace on a stage set to simulate smoke and flames. Hazers can be set up on a timer to operate on their own, and do not need an operator once they are set.