How can I sort collection items by publish date, not created date?

Cool that looks like it should work but I’ve minimal code experience…so I’m not sure where to paste it in when I click edit code. I don’s see anything obvious in liquid called a “collections.product” object

Is there somewhere particular to put this to replace the ‘created_at’ command in my current collection template ? or do I need to create a new template or something?

I can’t imagine ever wanting to sort products by creation date rather than publish date, so I’m ok with just changing that sort command to ‘publish_date’ site-wide, But if it is easier to do it for just one collection that’s cool too. need this working soon so whatever is easier