How to testfor if a zombie is not in a 10 block radius of a player

Solution 1:

Try this:

execute as @a at @s if entity @e[type=zombie,distance=10..] run stopsound @s * entity.zombie.ambient

It's stopping the zombie ambient sound if the zombie is 10 blocks away. You can also stop all the other zombie sounds using the sound IDs.