The wide-ranging law provides billions of dollars in tax credits to help consumers buy electric vehicles and companies produce renewable energy.