First, fog machines typically all work the same way. Simply add fog juice (sold separately) to the machine's tank and, after warming up, the fog machine will start producing artificial smoke. The key to shopping best fog machines (or at least the best for your purposes), the primary thing you'll want to consider is the size of the space you plan to use it in, since fog machines vastly differ when it comes to the amount of fog they output.
For use in a home, a smaller-sized, portable fog machine will work best, as a larger machine producing too much fog may set off your home's smoke detectors. For large spaces like an auditorium or for outdoor use, it might be worth investing in a professional-quality fog machine that can produce larger quantities of fog at a faster rate.
You should also consider whether you'd prefer a fog machine with built-in lights. Fog machines with built-in lights are popular for parties because of the additional ambiance they add, but if you're going for more of a scary haunted house vibe or your adding atmosphere to a play, you may want to skip the lights and opt for a more basic, fog-only machine.
For more details on the best fog machines you can buy, see the top three picks below.