Line an 8-inch square baking pan with parchment paper, leaving an overhang on two opposite sides to form a sling. Lightly spritz the parchment with nonstick spray or rub with a small amount of butter so the paper peels away cleanly from the fudge.
nonstick spray or butter
In a medium heavy-bottomed saucepan, combine the white chocolate and sweetened condensed milk. Place over low to medium-low heat and cook, stirring often with a rubber spatula and scraping the bottom and corners of the pan, until the mixture is smooth, glossy, and thick, about 5–7 minutes. Do not let it scorch.
3 cups white chocolate chips or chopped white chocolate, 1 can sweetened condensed milk
Once the white chocolate is mostly melted and smooth, add the butter pieces and sprinkle in the instant pistachio pudding mix. Stir gently but constantly until the butter is fully melted and the pudding mix is completely dissolved. The mixture will thicken and turn a light green color.
3 tablespoons unsalted butter, 1 box instant pistachio pudding mix
Remove the saucepan from the heat. Stir in the vanilla extract, almond extract (if using), and fine sea salt. If you want a deeper green fudge, use a toothpick to add a tiny dot of green gel food color and stir well, adding more only if needed.
1 teaspoon pure vanilla extract, 1/4 teaspoon almond extract, 1/4 teaspoon fine sea salt, green gel food color
Let the mixture sit off the heat for 1–2 minutes to cool slightly. Gently fold in the chopped roasted salted pistachios until they are evenly distributed throughout the fudge mixture.
1 cup roasted salted pistachios
Scrape the thick fudge mixture into the prepared pan. Use a spatula to press it into the corners and smooth the top as evenly as possible. A slightly rustic surface is fine.
While the fudge is still warm and soft, sprinkle the extra chopped pistachios evenly over the top. Gently press them into the surface so they adhere. If desired, finish with a light pinch of flaky sea salt for a sweet-salty contrast.
2-3 tablespoons chopped pistachios, flaky sea salt
Cover the pan lightly with plastic wrap or foil and refrigerate for at least 2 hours, or until the fudge is firm enough to cut. For very clean squares, chill 3–4 hours or overnight.
Use the parchment overhang to lift the set fudge out of the pan and onto a cutting board. With a sharp knife, cut into approximately 1-inch squares (or larger pieces if you prefer). Wipe the knife with a warm, damp cloth between cuts for neat edges.
Arrange the pistachio fudge on a serving platter or pack into gift boxes or tins. Store in an airtight container at room temperature (if cool) for up to 3 days, in the refrigerator for up to 2 weeks, or freeze for up to 3 months.