How can I prepare this natural gas line so I can connect a grill?
You would first turn off the gas at the meter. Then, if this pipe extending from the wall is indeed a gas line, you would take off the cap, clean the threads well, install suitable thread sealer made specifically for gas lines and install an appropriate gas shutoff valve. Install the grill gas connection down flow from this new valve using adapter fittings if necessary.

Then in case you ever need to disconnect the grill for winter, cleaning, replacement, moving or whatever else you can shut off this added valve without having to turn off all the gas in the house. 

If you ever do disconnect the grill from the valve it would be necessary to cap off the open valve end for safety sake --- just in case someone comes along and accidentally turns on the valve.