Find in an area

Hi,
I’m trying to find an entity in a specific area exemple.40x40 around an entity.
A screenshot :

But don’t know how to trace the area and search into if you can just give a function or anything else.

Thanks, Yazrihm.