/execute at @a run execute as @e[type=sheep,distance=..10] run say beeeeh
if you want it to happen only once every time you get close (instead of constantly) you have to do a little more:
/scoreboard objectives add beeeeh dummy (run once in chat)
/execute at @a as @e[type=sheep,distance=..10] run scoreboard players @s add beeeeh 1 (repeating command block)
/execute as @e[scores={beeeeh=1}] run say beeeeh (repeating command block)
/execute as @e[type=sheep] at @s unless entity @a[distance=..10] run scoreboard players @s reset beeeeh (repeating command block)