In either of these situations, you'd probably benefit greatly from soundproofing your walls. Soundproofing keeps noise out. Multiple soundproofing layers will work best at blocking noise, but less involved methods can also help reduce sound to hard-to-hear levels.
Do soundproof walls actually work?
Soundproof panels work reasonably well in reducing mid and high-frequency sound waves only as they have a moderate amount of mass. Soundproof panels do not block noise entirely as they are less capable of insulating low-frequency sound waves which have long wavelengths.
Does soundproofing work for noisy Neighbours?
The most common method to soundproof ceilings against noisy neighbours is to increase the mass and separation of the ceiling. Using acoustic insulation, soundbreaker bars and soundproof boards will effectively soundproof your ceilings from noisy neighbours.