The despawn glitch allows the player to manipulate what enemies or sprites do and do not spawn on a certain screen. It is most useful in Link's Awakening as it can be done almost anywhere with the Magic Rod.
Doing the despawn glitch with the Magic Rod is quite simple. Use the Magic Rod, then bring up the inventory menu on the next frame (will feel almost as if you're pressing the two buttons at the same time). Then, transition to the next screen before the fire spam despawns. Post transition, you will find that there are no enemies or sprites on the screen.
The Magic Rod version of the glitch can be used to despawn bosses, which is why it is so useful.
The shovel version of the trick can only be done in the Overworld as it requires digging soil. To execute, dig up a hefty amount of items, use a bunch of sprite-based items (bombs, arrows, magic powder, etc) Link has to fill the remaining sprite slots, and then leave the screen before everything despawns. Hopefully, if everything was done right, the next screen should be missing at least one or two enemies. This version of the glitch is quite difficult and very luck-based. It also isn't very useful, as there are only two places in the Overworld where it can be used.