President Obama ’s unilateral action on immigration angered many in Congress and among the public. With Republicans taking control of Congress, it is tempting to respond aggressively. Instead, a more measured and constructive approach would move the country forward and address the concerns that the voters expressed in the recent election.

To fix a system that the president admits is “broken,” Congress can pass legislation to deal with three issues. First, use market indicators to award green cards that favor immigrants in needed occupations and industries. Second, create a new class of visa that carries an annual fee, available to some of the undocumented, and provide for a guest-worker program. Third, use employer-based incentives to deal with illegal immigration, past and future.

Right now most immigrants come to the U.S. on the basis of family ties, not on the basis of their skills. Family reunification considerations are important, but they should not trump all others. Typically, fewer than one-sixth of immigrants each year obtain green cards based on their skills, according to the Department of Homeland Security.

More slots should be allocated on the basis of occupational needs. The easiest way to determine which industries and occupations are experiencing labor shortages is to identify those with rapid wage growth. When labor demand rises relative to supply, wages go up. According to Bureau of Labor Statistics data, information services, management and pipeline transportation saw the most rapid wage growth from 2006 to 2014. Data on industry and occupation vacancy and unemployment rates can also be used to determine labor-market demand.

Congress could allocate perhaps half of the annual number of green cards issued on a statistics-determined skill basis, where priority is given to skills for which demand is growing most rapidly relative to supply. Green-card entry criteria could be adjusted periodically to reflect labor-market conditions.

This reform would help the economy but several studies over the years show that it would not significantly depress domestic wages. One study by Zvi Eckstein and Yoram Weiss on the massive Soviet migration to Israel (Journal of the European Economic Association, 2004) revealed that immigration had at most small effects on the wages of the native-born. Robert LaLonde and Robert H. Topel (American Economic Review, 1991) and Giovanni Peri (Institute for the Study of Labor, 2014) provide evidence that immigrants have negligible effects on those already in a country—wage pressure, if any, is primarily on immigrants who came earlier. Using labor-market data to determine labor-market tightness will mitigate any adverse impact on wages.

In addition, perhaps 250,000 temporary worker visas can be issued annually to enhance already existing H-1 and H-2 foreign-worker visa programs. The new visa would allow workers to stay for up to two years and be concentrated in industries with shortages.

Most Americans accept that those who have entered illegally or overstayed their visas have committed a crime. Complete amnesty seems inappropriate and would encourage illegal entry in the future. As an alternative to deportation, however, one reasonable approach is to fine undocumented immigrants rather than deport them.

Congress could create a “Z” visa, to be issued to undocumented immigrants who can demonstrate that they have been in the U.S. for five years or more and have no criminal record. The visa would allow them, their spouses and children to stay, provided that they pay an annual visa fee of, say, a few hundred dollars. Anyone with a Z visa could apply for a green card, but would go to the end of the queue, continuing to have Z status during the waiting period, as long as the annual visa fee was paid.

Holders of the Z visa would be able to work while they wait for their green cards. A useful and equitable extension of the Z-visa system would be to allow a limited number of those who are not already in the country, but have been waiting patiently, to obtain Z visas and pay the visa fee while they await regular green-card status.

Finally, Congress should create appropriate incentives to apply for legal status. Employer enforcement is essential to ensure that the undocumented do not choose to stay in the shadows rather than pay the fee for a Z visa. Programs like E-Verify are necessary and should be enhanced. Firms should be fined heavily for hiring those who are here illegally, but given safe harbor as long as they check the status of new employees.

A system that penalizes employing those without legal status in the U.S. is also the best way to keep new illegal immigrants out. Border enforcement is necessary and uncontroversial, but immigrants who cannot work cannot afford to live in the U.S. According to the Pew Hispanic Center, nearly half of all illegal immigrants in the U.S. entered the country legally and overstayed their visas. The only way to close that avenue is to eliminate their employment possibilities.

Mr. Lazear, a former chairman of the Council of Economic Advisers (2006-09), is a professor at Stanford University’s Graduate School of Business and a Hoover Institution fellow.

overlay image