How did the highlighted thing come?

Greetings fellow learners, I hope you are doing well. It is requested to clarify how did the highlighted thing come?

X_train is a 2 D matrix —>

when you code something like
X_train[[True, False, True, True, True, False]]
it will return the values that has True of X_train so you will get array of [0,2,3,4]

pos is a array hold Boolean values (True, False) as it hold if Y_train==1 so it will return array hold True if he found 1 so
pos = [False, False, False, True, True, True]

so X_train[pos] mean X_train[[False, False, False, True, True, True]]

so it returned the Values where it is True → 3, 4, 5