The x coordinates of A and B are 9 and -1 in that order. Add them up to get 9+(-1) = 9-1 = 8. Then divide by two to end up with 8/2 = 4. The midpoint has an x coordinate of 4.
Repeat for the y coordinates. Add them up: 8+(-2) = 8-2 = 6. Then divide by two: 6/2 = 3. The midpoint has an y coordinate of 3.
Those two coordinates pair up to get (x,y) = (4,3) which is the midpoint of segment AB.