>>723263609
There are two ways to prevent the spread of corruption. One for Pre-Hardmode and One for Hardmode
Pre-hardmode, the biomes spreads over Grass and bushes. They also can't spread over each other. Infection range is 2 tiles from the source block. Sunflowers on the surface edges can block the spread easily. Same with stone or a big hole.
Hardmode it gets tricky. Corruption can now spread to more blocks and over the jungle and huge diagonal strips cut the world in a V shape at random.
The only way to prevent it spreading on your base is to dig large tunnels around the sections you want to save. They have to be wide enough and covered so that the corruption does not spread or create vines that spread. Then use purification powder and the clentaminator to remove any extra areas.
They use to randomly spawn corrupted blocks in hard mode everytime you break certain blocks too, but I believe they removed that.