How is a photon/particle measured when passing through one of the slits of the Double Slit Experiment? It is stated in many popular science videos that one of the reasons that quantum mechanics is so wacky is that if you measure which slit the photon/particle went through on the way, then you no longer get the interference pattern. I want to ask how that is done? How do we detect which slit it went through?
 A: Information about Double Slit Experiment:
In double slit experiment, light behaves like a wave when it's not observed (in simple words you don't know in which slit photon passed through), because it's a wave, when two waves meet each other they will interferece and on detector screen you will see interference pattern like this:

But if you will put detectors on the slits, you will observe in which slit each photon passed though, and because of that interference pattern will disappear, because by observing light, it no longer behaves like a wave (in other words it's wavefunction has collapsed) instead it behaves like a particle (Photon) so, on a detector screen you will no longer see interference pattern
Example of Quantum Eraser:
Easiest way to do that is to put polarizators on each slit which are opposite of each other (In other words first polarizator will pass photons which have polarization $\rightarrow$ and second will pass photons which have polarization $\uparrow$):

Because photons which have passed polarizators have different polarizations they can no longer interference (see: Interference of polarized light), so on detector screen you will no longer see interference pattern
Links for more info:
For more information about Quantum Eraser see this page, this page and this page
For a video about Quantum Eraser see this page
For more info about Interference see this page
