In a large saucepan, combine the sugar, milk, and cocoa powder.
Mix them well until smooth.
Place the saucepan over medium heat, stirring constantly until the mixture comes to a boil.
Reduce the heat to low and let it simmer.
Continue stirring for about 5 minutes or until the mixture thickens slightly.
Remove it from heat once thickened.
Add butter, vanilla extract, and salt into the hot mixture, stirring until fully combined.
Let it cool for a few minutes.
Pour the fudge into a greased pan and spread evenly.
Allow it to cool at room temperature before cutting into squares.