execute as @a if block ~ 5 ~ structure_void run tp @s X Y Z
execute as @a at @s if block ~ 5 ~ structure_void run tp @s 15 50 45
at @s
is needed if you want to test from the player position and not from the command-block position.execute as @a at @s if block 104 43 411 structure_void run tp @s 100 50 400