How do i convert this into c#

The language doesn’t look like JavaScript (UnityScript) or Boo, which were the only other two languages Unity supported in the past, as far as I’m aware. Wherever you got this from, it doesn’t seem like it’s related to Unity, and converting it into a C# script that interfaces with Unity’s API would be basically writing it from scratch.

Searching online for “Unity follow closest object”, this was the first result:

Maybe this will help instead.