Forbidding prevents dwarves from using an item or building. To forbid a building, go to list of items it contains and forbid them. The opposite to forbid is reclaim.
To mass forbid or reclaim items, use the appropriate designation from Set Building / Item Properties
submenu.