I'm a beginner and have nowhere to start when making the code.

How do I make it so that, when the player presses a brick, for example, an object (Not a Mesh) is welded onto their head (such as a hat)?

Thanks!