How to build an iron farm in Minecraft (26.x)
The golem appears on top of a solid block within 8 blocks sideways and 6 blocks up or down from the villager, but never on glass.

Glass is smelted from sand or red sand and lets light and sight through, which makes it the window block of the game. Mining it by hand breaks it for nothing: only a Silk Touch tool picks it up.
It is obtained in the Furnace from Sand or Red Sand.
Mobs cannot spawn on glass, so a glass roof or floor is a simple way to keep a base or a farm free of monsters while still seeing the sky. Light passes straight through it, and so does the beam of a Beacon.
Six glass blocks make sixteen Glass Panes, thinner and cheaper windows. Three make three Glass Bottles for water and potions. Eight around a dye give stained glass, and four amethyst shards turn a glass block into two Tinted Glass blocks that block light.
Several machines need glass: the Beacon (five, with obsidian and a nether star), the Daylight Detector, the End Crystal that respawns the dragon and the harness of the happy ghast. When sand runs out, a journeyman Librarian sells four glass for an emerald.
Any of: Sand, Red Sand → Glass
// Slots with several items cycle through every accepted option.
The golem appears on top of a solid block within 8 blocks sideways and 6 blocks up or down from the villager, but never on glass.
G = glass wall, B = bed, C = Composter, F = Farmland with carrots, X = baby exit, W = water under the wall.
Put 3 Leather on the top row, then Glass, Wool, Glass on the middle row.
In a Crafting Table, put 3 Glass across the top row, a Nether Star between 2 Glass in the middle row and 3 Obsidian along the bottom row.
In a Furnace: 1 × Sand or Red Sand gives 1 × Glass. Mined with Silk Touch, the block drops itself; without it, it drops nothing. Sold by Villager: Librarian (Journeyman).
It is the window block, crafted into panes, bottles and stained glass, and needed for beacons, daylight detectors and end crystals. It is an ingredient in 38 recipes, made at the Crafting Table; for example Blue Harness, Blue Stained Glass, Brown Harness, Brown Stained Glass, Cyan Harness and 30 more.
Placed under a Note Block, Glass gives the Hi-hat sound.