Should be a lighting instruction on the label on the water heater or furnace - on furnaces, sometimes on the inside of the front lift-off cover. Otherwise, google manufacturer website for owner's / operating manual - will have the instructions in there.
Some pilot lights you have to light with a long match or burning stick held at the pilot light fixture - or use a long-reach fireplace starter or even a hand-held propane torch (being careful notto burn any wires or sensors) to light it while you hold down the appropriate gas control button. In many cases the OFF-PILOT-ON button is pushed down while in the pilot position to get the pilot gas to flow, on other models you turn to PILOT and push an adjacent lighting button.
Other types have a piezoelectric lighter built in - a pushbutton which you press several times to create a spark at the pilot light. Sometimes at the gas control valve, sometimes the lighter push-button is at the door to the firebox.
In either case, you have to hold the pilot gas button down for 10-30 seconds till the gas pushes the air out of the pilot gas tube and till the thermocouple heats up enough to keep the gas valve open. The thermocouple (or thermopile in some cases - generally with gas control valves with LED indicator lights) generates a very small amount of electricity when it is hot, and this holds the gas valves [pilot and burner] open. Then when pilot is lit and burning by itself, turn knob to ON tio light burners. [If you release the pilot gas button too early, it will go out - I usually wait about 20 seconds before releasing.]