That code isolates the two bits indicated by the arrows below, and moves them to the two least significant bit positions.
vv
11111111111111111111111111111111 original value
vv
00000000000000000011111111111111 after >>18 (shift right 18 positions)
vv
00000000000000000000000000000011 after & 3 (mask out all but the 0th and 1st bits)
This assumes an unsigned value, and no special handling of the sign bit during the shift. The & (AND) is a masking operation because for the result to be 1 at any position, both the value and the mask must be 1 (i.e. 1 AND 1 = 1, all else is 0. So only the bits in the mask (the 0x03 in your case) can end up with anything other than 0, and they will only be 1 if they were 1 in the value being masked.
solved Simple logic operation >> &