How do you make a block kill you in Minecraft 1.13? [duplicate]

Run command:

execute as @a[distance=..1] run kill @s

or:

execute as @a at @s if block {name block} run kill @s