Yes, you can contribute to your HSA directly and indicate you are making a 2024 contribution until 4/15/25, as long as you had a high-deductible health plan (HDHP) and are contributing only up to the maximum for the year, depending on your plan, age, and the number of months you had the HDHP. Keep in mind that unlike payroll contributions, you won't get a break on FICA taxes.
Here is some information from the IRS you may find helpful: IRS Pub 969, and find the maximums for your plan type here: Why am I showing an excess HSA contribution?