A lot of it is just pattern recognition and practice looking out for forks, so that you don't fall into them as often.
There is one "easy-fix" thing which might help though. Knights can ONLY fork pieces on the same color as another. A Knight on a light-square can fork two pieces on dark-squares, or a Knight on a dark-square can fork two pieces on a light-square, but it can NEVER fork pieces on different colored squares from each other. Just keep your King and Queen on different color squares and it will be IMPOSSIBLE for a Knight to fork them both in one move.
There are times when it seems as though my queen gets forked with my king on a lot of my games. Any suggestions as to how not to get this to happen often.