Most fireplaces use a conventional pilot assembly, consisting of a thermocouple and pilot burner. Turn the knob on your gas valve to "Pilot." Depress and hold down the knob as you hold a match or lighter to the pilot itself. After one minute, release the button, and the pilot should stay lit. The thermocouple is a safety device which prevents the gas valve from releasing natural gas into the fireplace in case of a problem.
Locate the pilot light assembly underneath your logs. It is usually located near the side where the gas line enters the fireplace and connects to the gas valve. If necessary, remove the logs to gain access to the pilot light assembly.
Trace a thin, copper tube from the gas valve to the pilot light assembly. The slender tip of the thermocouple extends up in the pilot light assembly next to the pilot light itself.
Turn and depress the knob on the gas valve as per your fireplace manufacturer's instructions to release gas to the pilot light assembly. You should hear the faint hiss of released gas at the pilot light.
Light the pilot light with a match or lighter while holding the knob/button down. After the pilot light ignites, continue to hold the button down for one minute.
Watch the flame of the pilot light. The top third of the thermocouple should be surrounded by a blue flame from the pilot light. If the flame is weak or is mostly yellow, the pilot needs cleaning. If the flame is strong and blue and surrounds the thermocouple, but the pilot light still goes out after you release the button, then the thermocouple should be replaced.
Remove the two screws holding the pilot/thermocouple assembly in place. Disconnect the pilot gas line and thermocouple from the gas valve with a wrench, and remove the assembly from the fireplace.
The thermocouple will slide out of the pilot assembly. Clean the pilot light assembly with compressed air or by blowing on it. Replace the thermocouple if needed and reinstall the pilot light assembly.
Often a pilot light that won't stay lit needs only a good cleaning. The orifice in the pilot light assembly is a very small hole--less than a pinpoint--and can easily get plugged up. Keep the area around the gas valve and pilot assembly as clean as possible to avoid nuisance pilot light outages.
A pilot that won't stay lit indicates a potential problem with the gas flow to your fireplace. Do not force, over tighten, or otherwise modify the pilot assembly as natural gas may escape into your home. Read the instructions that came with your fireplace for additional safety information.