Line an 8x8-inch baking pan with parchment paper or foil, leaving an overhang on two sides to create a sling. Lightly grease the lining with butter or nonstick spray to prevent sticking, especially in the corners.
1 8x8-inch square baking pan
Roughly chop 1 cup of shelled pistachios so you have a mix of small and medium pieces. Set aside. If you plan to top the fudge, chop an additional 2–3 tablespoons of pistachios and keep them separate.
1 cup shelled pistachios, 2-3 tablespoons extra chopped pistachios
Add the white chocolate chips, sweetened condensed milk, and butter to a medium heavy-bottomed saucepan. A thicker pan helps prevent scorching.
3 cups white chocolate chips, 14 oz sweetened condensed milk, 3 tablespoons unsalted butter, 1 medium heavy-bottomed saucepan
Place the saucepan over low heat. Stir constantly with a heatproof spatula, scraping the bottom and sides as the white chocolate melts. Continue stirring until the mixture is completely smooth, glossy, and thick. Do not rush this step or use high heat, as white chocolate scorches easily.
3 cups white chocolate chips, 14 oz sweetened condensed milk, 3 tablespoons unsalted butter, 1 heatproof spatula or wooden spoon
Remove the pan from the heat. Stir in the vanilla extract, almond extract (if using), and fine sea salt until evenly combined. If you’d like a green tint, add 2–3 small drops of green gel food coloring and stir well, starting with less and adding more only if needed.
1 teaspoon pure vanilla extract, 1/4 teaspoon almond extract, 1/4 teaspoon fine sea salt, 2-3 drops green gel food coloring
Add the 1 cup of chopped pistachios to the warm fudge mixture. Fold gently but thoroughly so the nuts are evenly distributed throughout the fudge base.
1 cup shelled pistachios
Pour the fudge mixture into the prepared 8x8-inch pan. Use a spatula to spread it into an even layer, smoothing the top and pressing it gently into the corners. If desired, sprinkle the extra chopped pistachios evenly over the surface and press them lightly so they adhere.
1 cup shelled pistachios, 2-3 tablespoons extra chopped pistachios, 1 8x8-inch square baking pan, 1 heatproof spatula or wooden spoon
Let the fudge cool at room temperature for 15–20 minutes. Transfer the pan to the refrigerator and chill for at least 2 hours, or up to 3–4 hours or overnight, until the fudge is firm enough to cut cleanly.
Use the parchment or foil overhang to lift the chilled fudge out of the pan and onto a cutting board. With a sharp knife, slice into about 1-inch squares or rectangles. For very neat edges, wipe the knife with a warm, damp cloth between cuts.
1 sharp knife
Serve the pistachio fudge on a dessert platter, add it to cookie trays, or pack individual pieces into small boxes or cellophane bags for gifts. Store leftovers as directed.