There are lots of ways to do this: https://www.conjuringarchive.com/list/category/1170
The simplest way is Mark Wilson's Automatic Card Discovery (page 31, Complete Course in Magic). There is a whole chapter on "The Reverses" in Royal Road to Card Magic.
Ultimately, the method depends on...