How to make a function in C#

C#
public void SayHello(string name) 
{
    Console.WriteLine("Hello")  
}


Console.WriteLine("What is your name?")
string name = Console.ReadLine() ; 

SayHello(Adam) 
Source

Also in C#: