In this study, a switchable solvent-based liquid-phase microextraction method was developed to preconcentrate selected pesticides from tap water and wastewater matrices for determination by gas chromatography-mass spectrometry. A thorough optimization process was performed for prominent extraction parameters such as switchable solvent amount, concentration/amount of sodium hydroxide, salt type and mixing period. Optimum parameters obtained at the end of the optimization process were applied to aqueous standard solutions to validate the method. The linear dynamic ranges of all four analytes were appreciably wide with coefficient of determination values greater than 0.9997. The limits of detection and quantification (LOD and LOQ) were calculated for the analytes in the ranges of 0.38-2.0 ng/mL and 1.3-6.5 ng/mL, respectively. Spiked recovery experiments were used to validate the accuracy of the developed method and to determine the performance of the method in different sample matrices. Tap water, municipal wastewater and medical wastewater were spiked at three different concentrations and analyzed under the method's optimum conditions. The percent recovery results calculated for the samples were in the range of 79-107%, and this validated the method's accuracy and applicability to complex matrices such as municipal and medical wastewater samples.