How do you kill a player standing on a specific block?

execute as @a at @s if block ~ ~-1 ~ minecraft:grass run kill @s

This selects all players, individually checks each player to see if the block beneath them is grass, then kills off the player if it is.

A good place to look up what you can do with the execute command is on the Minecraft Wiki