It is a 2011 iMacYou are responding to a question that was posted 10 years ago.
iMacs from 2017 or later don't support optical audio output - although there's a page on Apple support that is a bit confusing because it talks about number of bits and bit rates (but that is actually talking about the digital-to-analogue converter inside the Mac).