Firstly teachers is an String array.
Dim teachers As String() declares your string array but doesn't specify how many items are in the array or initialise any of them (it is a Null reference at this point)
Therefore trying to allocate a string to an item in the array fails (with a NullReferenceException) because it is not been initialised:
teachers(0) = "Mostafa" 'Fails
teachers(1) = "Lina" 'Also fails
String.Split is a function that "Returns a string array", so when you call it, the Null Reference is replaced with a reference to a string array created by the String.Split function, so this works:
teachers = "Mostafa,Lina".Split(","c)
Alternatively you can declare and initialise the String array with one line:
Dim teachers As String() = {"Mostafa", "Lina"}