> The man
who works at Costco lives in Seattle.
> I gave a book, which was written by Hemingway, to Mary last week.
In above examples, "who works at Costco" modifies—or provides information about—the "man" who is the subject of the sentence.
In the second sentence, "which was written by Hemingway" modifies the object "book."
Using a reduced relative clause we can reduce the first sentence to:
> The man working at Costco lives in Seattle.
The second example sentence cannot be reduced because the relative clause "which was written by Hemingway" modifies an object of the verb "give."