Unplug your dryer. Locate and remove the access panel. This panel is typically located on the front of your machine and can be opened without using tools.
Set your dryer to its highest setting. Turn on the dryer. Because the electricity is off, the tumbler won't start, but the gas system will.
Observe the gas system through the access panel. Within a few seconds of turning on the dryer, the ignitor will begin to light up. Watch for 60 seconds. If the ignitor does not go out, you have a faulty flame sensor. Turn off your dryer.
Remove the wire leads that attach to the flame sensor. These may clip on or be attached with screws. Because the exact location of the flame sensor varies across brands, look at a schematic of your dryer to find the flame sensor. Look for a small box with two metal tabs running parallel to one another.
Remove the screw that holds the flame sensor to the interior of the dryer. The bottom of the flame sensor hooks onto the dryer with a small tab. Once the screw is removed, wiggle the sensor to free it from the dryer. Set the old sensor aside.
Position the new flame sensor so it is in the same spot as the old one. The hole in the sensor for the holding screw needs to line up with the hole inside your dryer. Use the screwdriver to insert the screw to hold the sensor in place.
Reattach the wire leads to the new flame sensor. Replace the access panel. Plug your dryer back into the socket.