If you wrote a story how do you get it published in a book?

You need to find an anthology that is about what your story is about. The best way to do this is to Google "anthology submissions" and add a word or two about your story subject. This will get you the names of any publishers who are currently accepting stories like yours -- if you find one, send it off. If you don't find one, check back every few weeks to see -- publishers are always starting new anthologies because they sell well.