We can query Custom Settings using the following Methods :
List Custom Setting Methods: The following are instance methods for list custom settings.getAll(): Returns a map of the data sets defined for the custom setting.getInstance(dataSetName): Returns the custom setting data set record for the specified data set name. This method returns the exact same object as getValues(dataSetName).getValues(dataSetName): Returns the custom setting data set record for the specified data set name. This method returns the exact same object as getInstance(dataSetName).