When one analyzes an object using a free-body diagram, one generally considers the possibility of all reasonable forces and eliminates the ones which are not likely to contribute to the acceleration of the object or are summarized by other forces.
For the object resting on a horizontal table in a gravitational field we immediately recognize there is a gravitational force, $mg$, downward on the object. If this was the only force, the object would accelerate downward, but it doesn't. That's because there are electrostatic forces acting to keep the object from falling through the table. We summarize this as a normal force, $N$, acting on the object, perpendicular to the contact surface and away from the table, and consequently, upward. This is not a reaction force to the $mg$ force.
Next, because there is a contact force, we must consider the possibility that friction is present. The friction will be parallel, in general, to the contact surface, and opposing to the sliding (not velocity) direction of the object. If the object is sliding, we consider the possibility of kinetic friction; if it is not sliding, we consider the possibility of static friction. In the case of the latter, the static friction will be what is needed to prevent sliding. If the table surface is perfectly horizontal and not accelerating, the required magnitude of static friction will be zero. (This would be an idealized case.)