If you have a 1099-B with 2023 on it, then it must go with your 2023 tax return. The stocks you sold in 2024, should have a new 1099-B next year with 2024 on it.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"