I do this too on my iPhone - like all the really good iPhone settings, it’s an accessibility option, under Display -> Color Filters. You can also set up the “accessibility shortcut” so triple-clicking the side button enables or disables it.
It really reduces the intensity of the phone - you never realize just how garish the color choices are for almost every app out there until you see it in B&W.
On my phone it's Settings => Display => LiveDisplay => Reading mode ("Grayscale mode for long-term reading"). I can also add a reading mode toggle button to the quick settings in the notification bar.
The search box in Settings will probably find it if you search for gray or reading.
This is on LineageOS 18 (Android 11), though I recall it being mentioned in some Google events/announcements so I'm 99% sure it's a core Android feature and not something specific to LOS.
It really reduces the intensity of the phone - you never realize just how garish the color choices are for almost every app out there until you see it in B&W.