buy out co-owner of house

If you buy a house with someone can you buy out the co-owner of a house if they want to move? How to buy out the co-owner of your house.