Hidden deep in the Settings app is the option to turn off auto-brightness.
Instead of letting the iPhone X automatically adjust how bright your display needs to be, Apple has tucked a toggle to disable auto-brightness into the Settings app.
It's a bit hidden, but here's what you need to do: Open Settings > General > Accessibility > Display Accommodations and slide the switch next to Auto-Brightness to the Off position.
Pay close attention to the warning just below the toggle. Because the iPhone X uses an OLED display, screen burn-in is inevitable, and by disabling auto-brightness you can potentially cause harm to your screen. It's up to you, of course, to decide if the risk is worth it.