The cotton gin promoted slavery, by making short staple cotton a viable an economically viable product. Short staple cotton grows where long staple won’t, opening more regions to cotton farming.
The cotton gin would never replace field hands.
The cotton gin removes seeds and straightens fibers. It does not plant, weed, or harvest.