You can only contribute to a 401k via payroll deduction. Unfortunately, this is something you should have planned ahead for if you wanted to maximize your contributions.
You could make a non-deductible Roth IRA contribution or a deductible traditional IRA contribution, depending on your eligibility (based on income and the fact that you participated in an employee plan for part of the year). If you are ineligible for a non-deductible Roth IRA contribution or a deductible traditional IRA contribution, you may be able to contribute up to $7500 as a non-deductible IRA contribution and then do a "backdoor IRA conversion".