hariḥ oṁ
~~~~~~
namasté

You have asked a question that is completely covered in patañjali’s¹ yogadarśana ( some call yoga-sūtras); look there and you will find these 4 sections:


samādhi...