In many layouts, a short occurs at turnouts when trains enter from the frog end where, of course, there are 2 paths. If you have a Kato #4 N scale turnout, there is a quick and easy solution.
Flip the turnout over and locate the 2 overlapping holes on the bottom cover of the #4 turnout. Together, they are marked "Frog Power". Then find the markings beside the overlapping holes which read "OFF" and "ON". Shorting will occur when the screw is in the "ON" position, so choose “OFF”. For more information on how the short occurs and other settings for this turnout, read on.
When you set the turnout's "Frog Power screw setting to ON, the internal switch energizes the frog with the correct polarity for one path through the turnout but creates the opportunity for a short through the other path.
Trains entering the point side of the turnout are guided to the correct path by the point rails. However, trains can enter the Frog end of the turnout through either the straight side or curved side. If the switch is not aligned for the path the train takes (by human error), you get a short.
This occurs when the engine's lead truck has a wheel of the front axle touching the frog and another wheel from the trailing axle (on the same side of the truck) touching the frog rail for that path. The assumption is that the wheels on each side of the truck pick up power and are connected electrically.
See the GIF diagram for turnout parts and naming conventions.
Whether you select "Power Routing" or "Non-Power Routing" for the corresponding settings of additional screws, 1. For "Curved Side" and, 2. for "Straight Side" is your choice according to if you want power to be passed to the direction of travel only or to both directions permanently. The latter choice is often chosen for DCC-enabled layouts. These 2 power routing settings will not cause shorting in either position. The #6 Kato N scale turnout has no “power routing” or “frog isolation” settings and will short when a train enters the turnout from the frog end if the point rails are not aligned for the same path. For this reason, some model railroaders elect to power DCC-enabled #6 N Scale turnouts with a separate power bus. Then, when the short occurs due to a mistake in direction setting, they can switch the turnout in the hope of eliminating the short by aligned for the correct path the train is using.
Some layouts use "frog juicer" boards which detect the short and reverse frog power electronically. However, to justify the extra cost, you need to have an engine that requires an energized frog to make it through the turnout with a consistent electrical connection. I have yet to find one. Also keep your tracks clean so you can rule out dirt as a cause for intermittent running.
The approach taken with the Kato #4 described above "isolates" the frog so it doesn't have to choose a polarity and be wrong 50% of the time. If you never have a misaligned turnout when entering through either frog end path (curved or straight) then you should not have a short from the train passing over the frog unless it has derailed.