In physics, work is defined as the energy transferred to or from an object by means of a net force acting on the object. If energy is transferred to the object, the work done by the net force is positive. If energy is transferred from the object, the work done by the net force is negative.
The work $W$ done by a constant force $\vec{F}$ is given by
$$W = \vec{F} \cdot \Delta\vec{x},$$
where $\Delta\vec{x}$ is the object's displacement while the force is acting on it. In this expression, $\vec{F}$ can be the net force (giving the total work done on the object) or it can be one of the individual forces (giving the work done by that force-- adding up all the individual work values gives the total work done by the net force).
From the definition of the dot product, we can see that $\vec{F}$ does positive work when it has a component in the same direction as $\Delta\vec{x}$ and it does negative work when it has a component in the opposite direction as $\Delta\vec{x}$.
It is possible to prove that the total work $W$ done on an object is equal to the object's change in kinetic energy $\Delta{K}$ over the time the work was being done:
$$W = \Delta{K}.$$
If a frictional force $\vec{F}$ acting on a sliding object is the only force doing work (think of an object in a vacuum sliding over a rough, horizontal surface), then we will calculate a negative value for $W$ for two reasons. First, $\vec{F}$ has a component opposite the direction of the displacement $\Delta\vec{x}$. Second, the object will slow down, losing kinetic energy, so that $\Delta{K}$ is negative.