A cobra rising from a dark lotus pond at night, a glowing jewel on its hood lighting the surrounding lotuses
This chaupai appears in the Balakanda section of Shri Ramcharitmanas.

सठ सुधरहिं सतसंगति पाई। पारस परस कुधात सुहाई॥ बिधि बस सुजन कुसंगत परहीं। फनि मनि सम निज गुन अनुसरहीं॥

This verse (chaupai) is also from the beginning of the Balakanda and occurs in the context of describing the importance of satsang (company of the virtuous).
Meaning : Even the wicked can improve through the company of the virtuous, just as iron becomes beautiful (turns into gold) upon touching the philosopher's stone. However, if by fate, a good person falls into bad company, they still follow their own virtues, like the gem on a serpent’s head. Just as the gem, despite being with the serpent, does not absorb its poison and continues to shine with its natural light, in the same way, a virtuous person, even in the company of the wicked, continues to spread light without being influenced by them.

As a Shalaka answer

This answer points towards company. The circumstances around the matter you asked about are not favourable; the path becomes clear only after leaving the company of the crooked. As things stand, completion of the work is doubtful.

Context: where this chaupai appears in Shri Ramcharitmanas

This chaupai also belongs to the satsang passage of Balkand. Tulsidas ji says that even the wicked are reformed by the company of saints, just as base metal touched by the paras (philosopher's stone) becomes gold. But if, by fate, good people fall into bad company, they still follow their own virtues; like the jewel on a serpent's hood, the company's fault does not stain them.

Read the full episode in Shri RamcharitmanasRead the complete episode containing this chaupai in Shri Ramcharitmanas, also known as the Tulsi Ramayan.

Word meanings

Sath
the wicked
Satsangati
company of saints
Paras paras
by the touch of the philosopher's stone
Kudhat
base metal
Suhai
becomes beautiful (turns to gold)
Bidhi bas
by fate
Sujan
good people
Kusangat
bad company
Fani mani
the jewel on a serpent's hood
Nij gun anusarahin
follow their own virtues

Transliteration

Sath Sudharahin Satsangati Pai। Paras Paras Kudhat Suhai॥ Bidhi Bas Sujan Kusangat Parahin। Fani Mani Sam Nij Gun Anusarahin॥

In Latin script this chaupai is also written as “Bidhi Bas Sujan Kusangat Parahin” or “Vidhi Bas Sujan Kusangat Parhi”. The spelling varies; the verse is the same.

Questions about this chaupai