Spawn C # Unity2D object platform

I'm creating a 2D platform game similar to Cat Mario and I'd like to know how to make a square appear when the player touches it with the head.