He carries a large hammer, which he uses to smash the ground and damage Daniel. This hammer makes him invulnerable, but it can itself be damaged. This means that Daniel has to destroy the hammer first, and then can shoot the Guardian, who responds by slamming the ground with his fists instead of the hammer.
The Guardian's attacks, however, are easily avoided by jumping just before he hits the ground with his hammer or fists, as the only way he can damage Daniel is through the ground, which can sometimes also knock Daniel high into the air causing him fall damage. But Daniel is invulnerable if he is jumping, even if the hammer comes down on top of him. The falling masonry from the ruins is also harmless for whatever reason. Ironically enough, this makes the Guardian much easier to deal with than the Necrogiant at the end of Chapter 1.