gild the pill is an idiomatic expression of the Portuguese language and means present something difficult or nasty as a softer thing and easier to accept.
It is possible to say that the expression "gild the pill" is related to the figure of speech known as euphemism. A euphemism is the replacement of a rude, shocking, or inconvenient term or expression with a milder or more pleasant one.
In English, this popular expression is often translated as "gold plating", whose literal translation is "to clothe with gold", but a better translation is "sugarcoat", which means "wrap in sugar".
expression source
Between 865 and 923, lived the Persian physician Rhazés, who was the first to have the idea of coating solid medicines or pills, so that they could be more easily ingested. He made use of seeds from a plant, seeds that have a sweet taste and that inside contain a substance that becomes viscous when it comes into contact with water. Thus, this substance wrapped the pill, making it sweeter and easier to swallow.
A few years later, a Persian philosopher named Avicenna, who at just 16 was already practicing medicine, used gold and silver leaves to coat the pills.
A tablet coated in gold paper looks better, although its taste hasn't changed in any way. Many pharmacists later used the same strategy to sell their pills better.
For this reason, the expression "brown the pill" is a way of masking reality, making something painful feel smoother. However, it is important to clarify that “gilding the pill” is not lying, it is sweetening a bitter truth.