The legislature and the executive branches operate separately from a separation of powers point of view, but that doesn't mean they're completely siloed off from each other. Executive agencies frequently work with Congress on bills that may impact their programs and operations.
Executive agencies will have Legislative Affairs offices that work as a bridge between Congress and the agency. It's their job to keep track of proposed legislation that may be relevant to their agency's work, to engage with Members and congressional staff on legislative proposals, and to communicate back to their agency's leadership about legislative events of interest. So the executive branch isn't just passively sitting back and discovering bills only after they've become law; they're constantly engaging with the legislative process and are well aware of new law and proposed legislation.
In addition, executive agencies have a General Counsel's office, which provides legal advice to the agency (depending on the situation, they may engage with other parts of the government like the Department of Justice or Office of Management and Budget on this where necessary). That office would be involved in reviewing the new law—ideally well before it becomes a law—and would provide guidance to agency management on what actions need to be taken to implement it. The exact details of this are going to vary somewhat from agency to agency; the process for the IRS to implement a major new tax bill (formulating new regulations, updating informational publications and internal manuals, changing tax forms, updating and testing computer systems, etc) will be different than the process for USPS to carry out a post office renaming.
In some cases, that implementation process would involve drafting new regulations or amending existing ones, which would go through the full rulemaking process before being finalized.