'/execute if entity' but with relative coordinates?
Solution 1:
What you want is /execute positioned
:
/execute positioned ~ ~ ~10 if entity @e[distance=..3] run <command>
This runs the command if there's an entity within a 3 block radius circle around a position 10 blocks into positive Z direction from you.