If you still have the original boxes then use that. If you threw away the original boxes and packing material then take the computer to your local UPS Store and ask them to box it for shipping for you, I would suggest double boxing.
Another option is on Amazon search for "24" iMac Shipping box" and you will find LOTS of options available.
Third, Sometimes you can find used boxes on Ebay. Do a search on Ebay for the model year iMac (Look in About this Mac) then in the Ebay search box type for example "2024 iMac box". Look for one that has the inserts, not just an empty box.
Finally, simply buy a box large enough at your local UPS store or moving store and lots of packing peanuts and make your own box.