Pumpkin grows wild in patches on grass across most Overworld biomes, and it is one of the few crops that appears as a whole block rather than a plant you harvest and replant. Once a stem is grown it keeps working: it pushes a new Pumpkin onto a bare dirt-type block beside it and never needs sowing again, so a pumpkin farm is really a row of stems, an empty square each, and something to collect the results.
Shears turn a placed Pumpkin into a carved Pumpkin, and the carved version is where the value sits. Worn in the helmet slot it lets you look at an enderman without provoking it, at the cost of a heavy frame around your view. Set on a stack of snow or iron blocks it is the head that brings a golem to life. Add a torch and it becomes a jack o'lantern, the pumpkin lantern that keeps burning underwater where a plain torch cannot.
Automating the harvest is the usual next step: an observer watching each growing square fires a piston that breaks the Pumpkin the moment it appears, and water or a hopper line carries it away. Stems only fruit onto exposed dirt, grass, farmland or podzol, so a fully paved farm produces nothing at all.
Two quirks matter for building with it. A piston extending into a Pumpkin breaks it and drops it whole — the very mechanism the harvester above relies on — so it cannot be shoved around a build the way most blocks can. And a note block sitting on top of one plays a didgeridoo, which is why pumpkins turn up under the floor of so many music builds.