Arrange a rack in the middle of the oven and heat the oven to 350°F. Line a rimmed baking sheet with aluminum foil.
Use a sharp paring knife to make shallow slashes along the surface of the squash (or pumpkin), 2 to 3 inches apart. Place on prepared baking sheet and roast until very tender, 1 ½ to 2 hours. A skewer or chopstick inserted into the squash should easily pierce through the flesh.
Set aside until cool enough to handle, 1 hour to 1 hour 20 minutes. Carefully tear or cut squash in half, then use a spoon to scoop out and discard seeds.
Scrape the flesh from the skin into a food processor fitted with the blade attachment. Process until smooth, about 2 minutes, stopping and scraping down the sides halfway through.
If using a sugar pumpkin (which tends to be more watery), place the purée in a fine-mesh strainer and set over a bowl. Drain until the purée looks thicker, at least 1 hour.
