Samadhi cannot be done by doing. Only the knowledge of nondoing does. That’s basically the understanding of jnana.
Samadhi is not about thoughts of knowing, but abiding in the consciousness illuminating the thought of knowing.
Samadhi isn't a verb but a noun. One doesn't do samadhi, but abides in samadhi. Samadhi is the alert, unwavering and balanced state of duality abiding in its nondual truth.
The practice of samadhi is within or without. That within of atman is self-inquiry, discriminating between seer and seen, in self-realization.
That without of brahman is more a metaphysical inquiry, looking beyond the superimposition to the substratum of absolute reality.