It's your choice who gets sent on, depending on the order you put them on your bench. Remember though that subs will always be sent on in such a way that the formation remains valid. In the case above, no matter who comes on your formation will still be valid so it's whoever you've selected in the first slot who'll come on.
If one of your defenders didn't play though, he would be replaced by a defender even if your midfielder was prioritised first, because teams need to have three defenders playing. If the two defenders on the bench didn't play either, the sub just wouldn't be made and you'd get 0 points for that player.