In a saucepan, before you turn the heat on, mix together the sugar, flour, and salt. Whisk in the milk. Whisk together until all the lumps are out and then turn on the heat. Heat until the mixture starts to simmer. Let it simmer for about 1-2 minutes. Remove from heat and add the butter and vanilla. Pour into a bowl or container and let it chill for at least an hour.