If both a WATER and an EARTH monster are on the field, you get both effects.
If the only EARTH monster on the field is your opponent’s “Giant Rat”, and your “Element Soldier” attacks and destroys it, there is no EARTH monster on the field when “Giant Rat”’s effect activates in the Graveyard, so “Element Soldier” no longer has the ability to negate monster effects and “Giant Rat”’s effect resolves as normal. (Monsters destroyed by “Element Soldier” that have effects that activate in the Graveyard will only have their effects negated if an EARTH monster is on the field at the time the monster is sent to the Graveyard.)
If there are no face-up EARTH monsters on the field, and “Element Soldier” attacks a face-down “Man-Eater Bug”, it is flipped up, and there is now an EARTH monster on the field when “Man-Eater Bug”’s effect would activate and resolve. So “Element Soldier” negates “Man-Eater Bug”’s effect.
Monsters that have their Attribute changed with “DNA Transplant” or “Scroll of Bewitchment” are included for “Element Soldier”’s effect.
If “Element Soldier” destroys “Sinister Serpent” while there is an EARTH monster on the field, “Sinister Serpent” cannot be added to your hand even if “Element Soldier” is removed from the field or loses its ability later on because there is no longer an EARTH monster.