First you grab the tile: When sprite clicked. Then you make a variable called cookie. Then you grab: change cookie by 1. Then grab: when (green flag) clicked. Then grab: set cookie to 0. Last grab: play sound pop until done.
I made this by myself. I saw a video cover called making a cookie clicker in scratch and I said "I could make that."