Work is defined as the product of force and displacement covered by an object in the direction of the force.
hence the formula: W= F*x
Newton's second law states that a body accelerates when acted upon by a net external force, and this force is directly proportional to the acceleration of the object and inversely proportional to the mass
hence the formula F= ma
work is related to the newton's law in the sense that the force that is required to do work or cause an object to move is calculated or can be found by newton's second law formula.
hence we can derive this formula: W= m*a*x or W= m*g*x if we consider projectiles