If you need a copy of your W-2 then ask your employer.You can get a free "Wage and Income" transcript form the IRS but that is is not a copy of the W-2 and contains no state information.https://www.irs.gov/individuals/get-transcriptYou can get an exact copy of the W-2 from the Social Security Administration for $81 per copy.https://faq.ssa.gov/en-us/Topic/article/KA-02501
You have to request the W-2s from the companies that you worked for.