Replacing a ceiling fan with a light fixture.
So I had a ceiling fan with a light in my room that I decided to replace with just a light fixture (basically getting rid of fan). The wires that are on the light switch are red black and ground, but when I took off the ceiling fan to expose the wires, I see black, white, red and ground, while the light fixture I bought only has black, white, and ground, and I've tried just hooking up the wires accordingly (White to white, black to black etc) but when I test it out, my light doesn't turn on. I looked up possible issues and I tried those but I still can't turn it on. When i turn the breaker on to test it, nothing sparks so I don't believe I'm doing anything wrong, but please tell me if I am.