Feature extraction is the process of taking raw data and transforming it into features that can be used for machine learning. Feature selection is the process of selecting a subset of features to use for training a machine learning model. Feature selection should be used when you have a large number of features and want to select the most relevant ones, or when you want to reduce the dimensionality of your data. Feature extraction should be used when you want to transform your data into a form that is more suitable for machine learning.