Lightly grease an 8-inch square baking pan or line it neatly with parchment paper, ensuring it covers the sides for easy removal. Set it aside.
In a medium-sized saucepan with a heavy base, combine the cocoa powder, sugar, and salt. Stir thoroughly until evenly mixed. Gradually pour in the milk while continuously stirring to achieve a smooth consistency.
Place the pan over medium heat. Stir constantly as the mixture heats up and begins to boil, ensuring the sugar completely dissolves. Once it starts boiling, stop stirring.
Insert a candy thermometer into the mixture and continue heating until it reaches 234°F, the soft-ball stage.
Remove the pan from the heat as soon as the correct temperature is reached. Carefully add the butter and vanilla extract on top, but do not stir. Allow the mixture to sit undisturbed until it cools to approximately 110°F.
Once the fudge reaches lukewarm temperature, use a wooden spoon to beat it vigorously. Continue mixing until the texture thickens, the sheen disappears, and the fudge starts to hold shape. This may take 8 to 10 minutes.
Immediately transfer the fudge into the prepared pan. Spread it out evenly and smooth the surface. Let it sit at room temperature until fully firm.
Once the fudge has set, slice it into squares and store in an airtight container at room temperature.