The Yarn Ball is a key item found in Extra Mode on the 2nd Floor. You can find it inside a barrel in the Barrel Room/Spider Room on the 2nd Floor. More specifically, it's inside the same barrel where you find the Rope in Normal Mode.
The Yarn Ball is meant to be traded with the white cat in the painting inside the Display Room, in exchange for the rope it's nibbling on.
Funnily enough, you can attempt to give this item to the Black Cat or The Librarian, to which they'll refuse. Attempting to give the Librarian the yarn ball multiple times will have him get annoyed at Viola.