It depends on what shade of yellow. Buttercup goes very well with teal or navy. Bright yellow goes well with grass green, bright red, or royal blue. Just keep in the same tone family (bright, muted, or pastel) and pretty much anything goes!
I would suggest a red colored cardigan to go with a yellow shirt. The color red suites with almost every color hence it would really bring out the yellow popped out shirt color. Note, for this to work out you the shirt should not have any colored stripes.