* Looking at your existing battery: If you can easily open the key fob, check the battery itself for the model number printed on it.
* Consulting your owner's manual: The manual should specify the correct battery type.
* Checking online retailers: Search for "[your year] Pontiac G6 key fob battery replacement" on sites like Amazon or eBay. The listings will often specify the battery type.
While CR2032 is the most common, there's a small chance a different battery might be used depending on the specific key fob version. Checking the sources above will guarantee you get the right one.