Capture untamed adult passive animals but throwing chicken eggs at them! It may take a few tries, but eventually you'll get a spawn egg that you can later use to respawn that captured animal.
When capturing a creature, the creature will lose its personality. For example, colored sheep will become white again.
You cannot capture monsters or villagers.