You read the suttas, understand their meaning, and put the teachings into practice. At the end of the day, how do you know if you have attained Nibbana? I think this is an important question because Nibbana is the ultimate goal and you need to know if you have finally reached the end.
Nibbāna is a state of 'deathlessness' (amata)- the "unconditioned". “This is immortality, that being the liberated mind/will (citta) which does not cling (after anything)” (Majjhima Nikaya 2.265; SN 5.9).
It is "bhavanirodha” (The cessation of becoming / "subjugation of becoming"). Nibbāna is “no longer coming (bhava) and going (vibhava)", It is "liberation (vimutta)". Nibbāna is not a place nor a state, it is an absolute truth to be realized, and a person can do so without dying. When a person who has realized Nibbāna dies, his death is referred as his pari-Nibbāna, his fully passing away. What happens to a person after his PariNibbāna cannot be explained, as it is outside of all conceivable experience. A definition of Nibbāna can only be approximated by what it is not. It is not the clinging existence with which man is afflicted. It is not becoming. It has no origin or end. It is not fabricated. It has no dualities. It cannot be described in words. It is not conditioned on or by anything else. In SN43:14 it is said:
“the far shore, the subtle, the very difficult to see, the unaging, the stable, the undisintegrating, the unmanifest, the unproliferated, the peaceful, the deathless , the sublime, the auspicious, the secure, the destruction of craving, the wonderful, the amazing, the unailing, the unailing state, the unafflicted, dispassion, purity, freedom, the unadhesive, the island, the shelter, the asylum, the refuge...”
Calling Nibbāna the "opposite" of samsāra or implying that it is apart from samsāra is doctrinally incorrect. It is probably best to understand the relationship between Nibbāna and samsara in terms of the Buddha while on earth. Buddha was both in Samsara while having attained to Nibbāna so that he was seen by all, and simultaneously free from samsara.
Simple answer: They see that there is no greed, anger or delusion arising in the mind anymore.
Long answer: You might wonder how someone can know they have no greed, it is possible that they haven't experienced greed for several months but they are not yet free from greed.
To answer this I think you have to ask a more basic question first: How does an enlightened know anything? or What does it mean for an enlightened being to know something?
Imagine that an enlightened person is looking at a bird in a tree and the thought arises "There is a bird", now we might say that they "know" that there is a bird. They make use of this information and scatter some seed for the bird to eat. But perhaps they had poor eyesight and the bird was actually a brown leaf, when they see that it is a leaf they do not suffer because they knew that the sight of the bird was impermanent and they didn't attach significance to it. They also knew that the thought "There is a bird" is something which just arises and passes, they didn't insist that the idea had to be true, if they had insisted that the bird existed then they would have suffered. Despite this they were still able to use the information and scatter some seed.
Likewise, if somebody is enlightened and they see evidence for nibbana (such as a year passing without greed, anger or delusion) then they have thoughts like "This mind is awakened" arising. They don't insist that these thoughts are true- just like the bird.