How to deal with platform-specific code?

OK, I had a look at UE4’s engine sources and have an idea - do I have to dig into UE4’s build system for this? Do I have to use Target.Platform etc.?