What kitaro mentioned is the feature of "self learning".
It comes with most (maybe all) new models of the garage door opener.
Unless you have a very old one, you should be able to program it easily.
See your instrument. Or get your brand and model #, then google for your instrument. You must be able to find what you want to do. Otherwise, your opener don't provide this feature, I guess.