Usually you buy an excluder. It needs great precision to work at it's best. If you are too poor or too cheap to buy one, #5 hardware cloth will work, but is harder on the bees than a real excluder.
If you only need a temporary one, the plastic ones are cheap. If you want a permanant one, I like the wood bound ones the best.