For example, in this case, this becomes \(F + N - m g = 0\), where \(N\) is the normal force exerted by the surface and \(F\) is another external force.

\(F\) and \(N\) act upwards, so, they have positive signs in the equation. The weight acts downwards, so, it has a negative sign in the equation.