There are several ways to return a promise... $http returns a promise with each of its ajax calls, $timeout also returns a promise.

That being said you want to return a promise based upon something other than a scheduled event ($timeout, $interval) via $q you can do this...

// assume $q is injected into your service/controller/factory
// create a defer object
var defer = $q.defer();
// do something...
if (doSomething()){
defer.resolve(); //something went right
else {
defer.reject(); //something went wrong
}
//make sure you return out the promise, so the consumer can act upon it.
return defer.promise;

Also, $q has some nice helper methods to return a promise that you can use when you stub out some logic;

// this will a promise that will resolve with the value provided
return $q.when({some: 'result'});
// this will return a promise that will reject with the error specified
return $q.reject('some error message');