When the moves of Golem are all ground-type, Mud Shot and Earthquake, Fearow is one of the best Pokemon for fighting against it. While Fearow decreases the damage of ground-type moves due to its flying-type, it can use moves, Steel Wing and Drill Run, which are super effective against Golem (Steel Wing is a steel-type move, and Drill Run is a ground-type. Golem is weak to both of those types).
When the Golem's moves are all rock-type moves, for example Rock Throw and Ancient Power, Machamp is one of the best to defeat it. The damage of Golem's rock-type moves are not very effective against a fighting-type Pokemon, where as Machamp's fighting type moves are super effective against Golem.
Not only a fighting-type Pokemon, but also ground-type Pokemon can cut the damage of rock-type moves. Since many of ground-type Pokemon can use ground-type moves, which are super effective against Golem, they can have an advantage.
When the Golem's moveset is a combination of rock- and ground-type moves, fighting-type Pokemon can work well. For example, Primeape can reduce the damage of a rock-type move Golem use and can attack Golem with fighting type moves as same as Machamp described above.
Ground-type Pokemons can reduce the damage of rock-type moves. Ground-type moves are recommended to be learned since Golem is weak to those moves. Select the one you can easily get to bring in a gym battle against Golem.