Bugs appear to sleep. They spend a lot of time in a state called torpor. During torpor, insects don't move unless aroused by a strong stimulus such as a predator attacking.
Insects do not have eyelids and cannot close their eyes. They also don't have centralized brains like mammals do, so it is difficult to determine if their brainwaves during torpor resemble those of a sleeping mammal. However, torpor functions to rest and rejuvenate insects. Monarch butterflies gather in large numbers at night and enter into torpor as a group to rest from migration. Other insects enter torpor during difficult environmental conditions, such as cold temperatures.