My Galaxy A40 was flickering black and white and all these colours when i dropped it with my headphones plugged into the headphone jack. It was really hard to tell what was on the screen and was just barely able to see some icons and text in the mess of the flickering. I plugged it into my laptop and using scrcpy (a program which allows to use your phone via USB), i was able to use my phone from the laptop perfectly. Later, i accidentally dropped it again while it was plugged in and the screen flickering became more white but less frequent. A minute later, the screen completely just turned off, but I was still able to use it through the laptop with scrcpy. As of now, it is still like this. I feel like this is an internal hardware issue as there is no visible cracks on the screen, although under the glass on the top right corner, it looks like there is a slight crack inside. The headphone jack and speaker still works as I was able to listen to sound when I launched youtube through scrcpy. The touch screen also works fine as I had "Show taps" enabled when i watched through scrcpy. It is just the display with the problem. All buttons still work fine.
Sorry of this seems rushed through as I was extremely panicked when I wrote this.
It was almost impossible for me to see anything on the screen (like what an app was showing or home screen info) after it was dropped and the headphones which were plugged in was HyperX Cloud Stinger (wired) if this helps at all.
If anyone could help fix this problem, I cannot explain how thankful I would be if you helped.