Depression is an extremely serious illness of humans which causes constant mood swings and feelings of sadness. Nowadays, it is considered to be a deadly disorder in the world. At present, everyone from young to old is suffering from depression but most of them do not have the right idea about their mental state. Everyone needs to have a proper idea about their mental state. We will detect depression through a machine learning-based detection approach. Talking with psychologists and depressed people, we find some factors that are related to becoming depressed, and depending on those factors, information is collected from both depressed and non-depressed people. After applying preprocessing techniques, a processed dataset was created finally. Then, feature selection techniques were used. We applied eight machine learning algorithms and two feature selection methods to our dataset. We used k-nearest neighbor (k-NN), decision tree (DT), linear discriminant analysis (LDA), adaptive boosting (AB), support vector machine (SVM), naive Bayes (NB), random forest (RF), and logistic regression (LR) classifier. In our work, the RF classifier gave the best performance based on accuracy and the accuracy of the RF classifier was 96.00%.