I was searching for this before I got my new TV and couldn’t find a definitive answer so I just wanted to make a post to confirm that an RPi 4B (4gb ram) delivers a 4K signal to my TV (samsung s95b but presumably that shouldn’t matter). I whitelisted all of the resolutions (didn’t know about this before) and also edited config.txt to make 4K available (not sure if that’s necessary).
The Raspberry Pi 4 supports 4K without any modification. This device does not have 4K @60hz enabled by default however and that would require a modification to config.txt to enable if one desired that feature and had hardware that supported it. A whitelist is not necessary but one may find it desirable to do so. Really the only relevant settings would be to have your GUI set to 1080p and refresh rate switching enabled but both of these should be default settings in a new install.