Gas fireplace won’t stay lit
All such units have a safety device to prevent the main valve from opening if the pilot is not lit. When these go bad, the system thinks the pilot is not lit (even if it is) and the main gas valve will not open.

Sometimes this device is a simple thermocouple, sometimes it is a bundle of thermocouples encapsulated in a tube, called a thermopile or pilot generator. They work on the same principle: when heated they supply a low-voltage signal to the gas valve, as a permissive for it to open (on thermopile units it actually supplies the power that opens the valve).

This would be the first thing to check, look for a small cylindrical device that sits adjacent to the pilot flame such that it would be heated by the pilot. It will have either a pair of wires or a thin copper tube that leads to the gas control valve.

This is only one of many things that could go wrong, but it is a common issue and easy to rule out because they are fairly easy to replace and inexpensive.