LivingSpawnEvent is the parent of several events, don't subscribe to it directly unless you want to receive every child and you don't care which one is which (which usually isn't the case).
LivingSpawnEvent.CheckSpawn is only fired for living entities that spawn passively (in WorldEntitySpawner) and for entities that spawn from mob spawners (in MobSpawnerBaseLogic). Setting the result to DENY will prevent the entity from spawning.
LivingSpawnEvent.SpecialSpawn is fired just after LivingSpawnEvent.CheckSpawn in the same places. Cancelling it will prevent the entity from spawning.
LivingSpawnEvent.AllowDespawn is fired when a living entity is about to despawn, setting the result to DENY will prevent the entity from despawning.
EntityJoinWorldEvent is fired when any entity is about to be spawned (regardless of what kind of entity or where it's being spawned from). Cancelling it will prevent the entity from spawning.
LivingSpawnEvent.CheckSpawn, LivingSpawnEvent.SpecialSpawn and EntityJoinWorldEvent can all be used to prevent entities from spawning, the difference is which entities the events are fired for and which additional effects will be prevented when you cancel/deny the event. If the entity is covered by the LivingSpawnEvent children, you should prevent the spawn as early as possible (i.e. with LivingSpawnEvent.CheckSpawn) to stop any additional effects related to the spawning from happening.