Minecraft conditional subcommand entity introduction

entity
Check whether one or more specific entities exist
Format: if/unless entity <target entity>
Explanation:
The entity parameter is equivalent to the testfor command before 1.13. It is usually not used alone, but with some specific tags. For example:
/execute if entity @e[name="Pineapple",distance=..3] run give @a minecraft:diamond 2
If the distance between "Pineapple" and the command executor is less than 3 squares when the command is executed, then give all players 2 diamonds.