Illustrator - Define and use pattern

How can I define a pattern and then use it like you would in photoshop?