Singleton pattern is a design pattern that restricts the instantiation of a class to one object i.e., it ensures a class can have only one instance and provides a global point of access to it.

Consider below C# example of Singleton Pattern

//Note here that the class is sealed ensuring that it cannot be inherited
public sealed class SingletonA
{
 //Here below is private constructor so that it can be accessed only from this class
 private SingletonA()
 {

 }
//In below line we are creating a static object of singleton class that it can be accessed locally
private static SingletonA obj=null;

 //Below method is public method which is accessible for getting instance
 public static SingletonA obj
 {
 get{
 if(obj==null)//It will be null for first time only, from second time 
 onwards it will return obj
    {
      obj=new SingletonA();
    }
 return obj;
   }
 }
}

Note: The above code is simple example of singleton pattern only. But in complex situations when two or more different threads both access or hit the code(obj=null) at same time it will create multiple instances violating singleton pattern

Hence Thread safe singletone pattern is recommended where we use lock to provide thread safetly and maintain singleton pattern.

Below is the example of thread safety singleton

public sealed class SingletonA
{
private SingletonA()
{

}
private static readonly object padlock=new object();
private static SingletonA obj=null;
public static SingletonA obj
{
get{
lock(padlock)
{
if(obj==null)
{
obj=new SingletonA();
}
return obj;
}
}
}
}

Tips:
Note that big difference between a singleton and static methods is that singleton can implement interfaces and classes while a static class cannot.
A Static class allows only static methods whereas a singleton allows access to a single created instance which can be passed to other methods.
A singleton object is stored in Heap whereas static objects are stored in stack
We can clone the singleton object but we cannot clone the static class object