If you stand out in the open, chances are a machine is going to notice you. To greatly mitigate this risk, try hiding in tall grass whenever possible. You can do this by crouching while standing in tall grass. You’ll be rendered nigh-invisible to machines if they haven’t spotted you...
Then, make your way through the transparent pipe, up to the second floor to reach a Koopa Troopa. Stomp on it, grab its shell, and take it just below to where the Goomba is. Next to the Goomba are a few purple blocks. Take out the Goomba, then line yourself up to face the wall ...