First off, you can do [dimensionality reduction](http://stats.stackexchange.com/questions/tagged/dimensionality-reduction) of features independent of any particular prediction problem, i.e. [representation learning](https://en.wikipedia.org/wiki/Feature_learning). In the context of prediction problems, sparsity-promoting [regularization](http://stats.stackexchange.com/questions/tagged/regularization) can be used to automatically perform [feature selection](http://stats.stackexchange.com/questions/tagged/feature-selection). This is commonly accomplished using $L_1$ penalties such as [LASSO](http://stats.stackexchange.com/questions/tagged/lasso) for linear regression (and also in [deep learning](http://www.deeplearningbook.org/contents/regularization.html)). ($L_1$ regularization is also used in representation learning, such as [sparse coding](http://stats.stackexchange.com/a/118490/127790) and [sparse autoencoders](http://www.deeplearningbook.org/contents/autoencoders.html)).