We know that Young's double slit experiment shows that light is a wave. On the other hand photoelectric effect shows that light is made up of photons. How can light be both at the same time?
It act as a wave, but this wave is a probability density function, which describes the chances to hit a particular location of the detector.
You cannot predict where it strikes, but if you fire enough photons or electrons, you will see an interference pattern. Described by this function.
If you fire one particle at a time, then you will see individual particles hit the detector. They hit with higher chances where the interference pattern is strong, but you won't see a hit where the interfering waves completely cancel out each other.