It is not clear how the stone would sink into his forehead. Perhaps it hit him on the side of his head to make a visible dent in the helmet he was wearing. This would then knock him unconscious for some time. The fact that Goliath ends up falling face down on the ground draws a parallel with the fall of the Philistine god Dagon (1 Samuel 5:3–4).1
49 And David put his hand in his bag and took out a stone and slung it and struck the Philistine on his forehead. The stone sank into his forehead, and he fell on his face to the ground.