By default, the auto-brightness feature is enabled on your iPhone.
If you want to disable it, here are the steps (here, I’m using iPhone X (iOS 13.3)):
Hit Accessibility which you can find between Display & Brightness and Wallpaper.
Tap Display & Text Size which you can find between Magnifier and Motion.
Now scroll down to the bottom. Hit the toggle switch beside Auto-Brightness, which you can find beneath Reduce White Point.
Note: you can follow the above steps to enable the auto-brightness feature.