When Dream Eater enters the battlefield, surveil 4. When you do, you may return target nonland permanent an opponent controls to its owner's hand. (To surveil 4, look at the top four cards of your library, then put any number of them into your graveyard and the rest on top of your library in any order.)
Dream Eater’s triggered ability goes on the stack without a target. While that ability is resolving, after you’ve surveilled, the reflexive triggered ability triggers and you pick a target nonland permanent to be returned to its owner’s hand. This is different from effects that say “If you do . . .” in that you choose the target after having surveilled.
Dream Eater’s reflexive triggered ability triggers even if you have fewer than four cards in your library to surveil.
When you surveil, you may put all the cards you look at back on top of your library, you may put all of those cards into your graveyard, or you may put some of those cards on top and the rest of them into your graveyard.
You perform the actions stated on a card in sequence. For some spells and abilities, you’ll surveil last. For others, you’ll surveil and then perform other actions.