Use a piece of spaghetti to light the pilot. This way it is long enough that you do not burn your hand.
Call the gas company as your pilot should not be going out. They typically will make a house call for free. Could be a clogged gas line.
To light it no matches use long butane lighter(for BBQ or candles) get them any store or online; to get it to stay lit may need to adjust it so more gas comes out or may need cleaned or replaced. ADJUSTING https://homeguides.sfgate.com/adjust-pilot-light-47952.html
I agree with Naomie. Call the gas company. They can check it out for free. Could be a sensor, thermocouple, or pilot valve. Nothing to mess around with.
Call the gas company / if new appliance call them . Something is wrong light should not be going out ! DANGEROUS, LIGHT COULD GO OUT WHILE
YOU SLEEP ! COULD BE TAKING A LONG NAP ! Please have professional look at that !
Hope you have called your gas company - these folks are right - this is extremely dangerous situation.
If the problem is that gas doesn't reach & ignite burner 'jets' equally when turned on, strip the paper or plastic off baggie ties & with burner OFF, use just the thin wire in a baggie tie to clean out each of the burner jet holes.