If the content never existed in the first place, you should return 404. Crawlers will know that there's nothing to see on that page and move on.
If the content used to exist at that URL but no longer does (for example, a product was removed from the website), you should return 410.
404 means there is nothing at this URL. 410 means that there is no longer anything at this URL. While it's a subtle difference, a 410 error code will tell crawlers to stop trying to access that page and will (most likely) drop it from their indexes. This really won't make too much of a difference in your SEO rankings besides letting search engines remove URLs of de-listed products. If implementing this is laborious, you really don't need to- 404 will suffice.
From httpstatuses.com:
410 GONE: The target resource is no longer available at the origin
server and that this condition is likely to be permanent.
If the origin server does not know, or has no facility to determine,
whether or not the condition is permanent, the status code 404 Not
Found ought to be used instead.