How do the departments and agencies of the executive branch work to implement the law?
Generally, what the agencies in the executive branch do is take the laws and do two things. First, they make the laws more specific by writing rules that are based on the laws. Second, they enforce those rules in a variety of ways.
When Congress writes laws, it does not tend to make them very specific. It will set general goals (get students up to grade level by year X for example) and leave it up to the bureaucrats to write rules specifying how this must be done.
The other thing that bureaucrats do is they enforce the laws. They may, for example, go out checking on businesses to make sure that they are following the laws in terms of worker safety.
So the executive agencies tend to write rules to flesh out laws and they tend to enforce the laws and rules. By doing these things, they implement the laws.