Phantoms are the fastest mob in the Overworld. Players are unable to outrun them. A good strategy versus phantoms is to obstruct their path, since they fly up if they collide with any block during an attack.
Cats hiss at phantoms that are currently attacking players, and phantoms try to stay at least 16 blocks away from them.
Phantoms do not spawn if the player has a solid block above them, meaning they do not spawn around players underground or within enclosed structures. Additionally, they do not spawn if the player is below sea level.
Sleeping through the night is not actually required. The statistic that controls their spawning is reset when the player leaves a bed, so simply entering and then leaving a bed is enough.