Greetings valk welcome to the Form.
Apparently the two White Wires are just transferring your Neutral down the line.
I'd hook the White wire of the Fixture up to those White Wires in the Box.
Now,
Scenario 1:
The Black Wire in the Box, may have a Switch controlling it somewhere, so first, hook the Black Wire of the Fixture up to it, and find the Switch.
Leave the Cap on the Red Wire in the Box.
Scenario 2:
If the Light has a Switch in it, then hook the Black Wire of the Light up to the Red Wire in the box, and use the "pull switch" to operate the light.
I strongly suspect that Scenario 1 is the way it should work, and if not, then you may have a bad Switch (somewhere) that needs to be replaced too.
Have a good Day !

S.W.