In 2269, he welcomed James T. Kirk, Spock and the crew of the USS Enterprise to his planet, before announcing that there were countless spectators there who were about to bear witness to the drama that was about to unfold on the stage that was created on their behalf in the form identical to that found on Earth. Yarnek then explained to Kirk that the Excalbians had bestowed the honor upon them to demonstrate a confrontation of the two opposing Human philosophies, "good" and "evil", which in addition to their own spectators, they allowed the crew of the Enterprise to also view, so that they "may also enjoy and profit from the play."
He arranged for a conflict with Kirk, Spock, and recreations of Abraham Lincoln and Surak on the side of "good," versus Colonel Green, Zora of Tiburon, Genghis Khan and Kahless the Unforgettable on the side of "evil." The theme was, to the Excalbians, "a simple one: survival, life and death," in an attempt to determine which philosophy was the stronger, as they learned by "observing such spectacles."
When Kirk and company decided to focus their efforts on making their captors the enemy, Yarnek expressed his disappointment, stating, "[w]e offer you an opportunity to become our teachers by demonstrating whether good or evil is more powerful. [....] I must conclude that your species requires a cause to fight for." Consequently, the Enterprise began to experience a breakdown in the shielding between the ship's matter and antimatter, leaving the ship with four hours before it would blow up, provided Kirk and his party were able to defeat the representatives of evil.
After over two of the four hours had passed, Kirk and Spock had sufficiently defeated the representatives of evil so as to force them to retreat. Yarnek, however, did not feel that, despite their victory, they were able "to demonstrate to me any other difference between your philosophies. Your good and your evil use the same methods, achieve the same results." When Kirk pointed out that Yarnek had ultimately established the methods and goals, Kirk argued as to what right Yarnek had to conduct such a spectacle, leaving Yarnek to respond, "[t]he same right that brought you here. The need to know new things." (TOS: "The Savage Curtain")
Yarnek's name was not spoken on screen, but rather comes from the episode's script.
Yarnek appears in Star Trek Online, in the two-part mission "The Measure of Morality". As his first attempt to understand good and evil was inconclusive, he forces the player character, along with one of their crewmates and Seven of Nine, to participate in various trials, aided by re-creations of President Lincoln and Michael Burnham. Yarnek is initially moved to believe evil is better than good due to their ruthlessness, when the characters defend Yarnek from the Excalbians' abilities being hijacked by a Seven of Nine that had become a Borg Queen in one of the trials, he is instead moved to accept the concept of good.