Minecraft command damage on blocks?

pa
4

What does a possible command look like if I want you to be on a specific block such as Want to damage 0.5 hearts per second?

Ps. I have no idea about commands.

au

/ execute at @a if block ~ ~ -1 ~ minecraft: white_wool run effect give @p [distance = .1] minecraft: poison 1 4 true

This means that every player who loves white wool gets damage (version 1.15)

Ti

Do you write that in a normal command block?

au

Yes, but a clock must then be connected to the command block or the command block is set to repeat

Be

In a repeat command block (the blue one)