Laws are passed by the legislature (Congress), as the legislative branch of government.
Agencies such as the EPA are part of the executive branch of the federal government. Agencies make regulations that implement the laws, a power given to them by particular pieces of legislation. The EPA derives its powers from various acts, such as the Clean Air Act, the Clean Water Act, and the Endangered Species Act. The EPA also investigates complaints and alleged breaches of these laws or regulations, and makes administrative orders directing individuals or organizations to pay a settlement or take action.
The courts are part of the judicial branch of government. If an individual or organization does not comply with an administrative order, the EPA can take judicial action against them in the courts. Alternatively, an individual or organization can file a lawsuit against the EPA if they have suffered damages due to the agency's actions or inaction. They can also petition for judicial review of an EPA order (which is similar to an appeal of a court decision).