There are many ways to stop noise transferring through walls. Some methods are more effective than others, and some may be more suitable for your particular situation.
One way to reduce noise transfer is to add mass to the wall. This can be done by hanging heavy curtains or installing acoustic panels. The added weight will help absorb sound waves and prevent them from passing through the wall.
Another way to reduce noise transfer is to increase the insulation in the wall. This can be done by adding new insulation or filling any gaps in the existing insulation. This will help block out sound and keep it from passing through the wall.
If you live in an apartment or condo, there may be rules against making changes to the walls. In this case, you can try using a white noise machine or fan to create background noise that will mask other sounds coming from outside your unit. You can also try sealing off cracks and gaps around doors and windows with weatherstripping or caulk to further reduce sound transfer.