Changing position.

I am a new in coding and I have a question.

I have puck and static object: goal

So I want when puck collides goal,goal changes position on the half of the screen.

How can I do that?

Please write me a code if you can.

Thank you!