To set bit k (make it 1) in number n, you OR n with 2k. This guarantees bit k becomes 1, while leaving all other bits unchanged.
The OR operation turns bits on. Since 1∣1=1 and 0∣1=1, ORing with a bit that's 1 forces that position to 1 regardless of what was there before.
Example: Set bit 1 in 12=1100. Compute 12∣(1<<1)=12∣2=1100∣0010=1110=14. Bit 1 is now on.