It depends on whether your former employer pays the severance in 2024 or in 2025. Ask them if they will pay it in 2024 and include it in your 2024 W-2, or if they will pay it in 2025. There is no rule about how they do it. It could go either way.
You said you "left" your job. That sounds like you quit voluntarily, not like you got fired or laid off. You don't usually get severance pay if you leave a job voluntarily. Are you sure you are going to get severance?