In the double slit experiment (with electrons), physicists wanted to know which of the two slits the electron passed through. Of what use is knowing which slit the electron passed through?
There is no use in knowing which slit the electron went through. The whole experiment is used to highlight experimental effects that classical mechanics cannot explain.
Showing an interference pattern indicates that electrons behave like a wave. But electrons also often behave like particles. Which one is true? Classical mechanics can only explain one or the other, not both at the same time.
QM however claims that electrons can behave as both, particles and waves. The experiment shows how the apparent contradictions raised by this claim are „resolved“ by QM: The moment you try to to measure which slit one single electron went through, i.e. the moment you localise the electron at a specific position (which can only work for particles), the electrons stop behaving like waves and start behaving like particles.
All these statement I made here should not be taken too literally. As far as I know, we still have no complete understanding about what exactly is going on. But we know exactly how the maths works and how to perform the QM calculations. The results are in complete agreement with the experimental observations.
It is not so clear what you mean with "use" in your question. But in a scientific context, the information through which slit the electron went serves for the understanding of the experiment. Physicists want to know what is going on. However, it turns out that if one tries to check through which slit the electron went, the actual experiment is destroyed since the interference pattern generated by the electron waves disappears. The conclusion on this observation, and this is ground-breaking, is that in the view of Quantum Mechanics the quantum-mechanical state which describes every electron undergoing this experiment is a superposition of position eigen-states. Or in different words, a state where the electron "seems to be" at 2 different positions at the same time (called a superposition of position eigen-states) what contradicts classical physics. So, if you like, the "use" of the desinformation of the electron's location is ground-breaking (violating) classical physics (and the attempt to understand Quantum Mechanics).
Not sure what you mean by "use", but this is part of the experimental protocol. When a particle detector is positioned so that it can tell which slit each electron passes through then the electrons behave as particles and do not interfere. Without the particle detector the electrons behave as waves and create an interference pattern.
The original double-slit experiment with light showed that light, which was classically regarded as a wave, could also behave like particles. The electron version of the double-slit experiment confirmed that electrons, which were classically regarded as particles, could also behave like waves.
The "use" of an experiment is to prove a point. The original experiment by Young in 1801 proved the interference of light. Later experiments at very low intensity proved the particle nature of light. The experiment with electrons in 1927 proved the probability wave nature of matter.
This answer overlaps with one of the other answers.