Switch to Timmy and shoot stars at the jar holding him.
Timmy's star shots are the only thing that breaks it, so if you've been trying with other characters, that's why nothing's happening. Keep firing until the jar gives way.