I come across some phrases such as “best avoided,” or “better avoided.” I understand what it means, but don’t know how this phrase was made. What grammatical structure is in this? I thought this phrase is short for “is best (when it is) avoided,” but this underatanding is just based on my rudimentary grammar. Could anyone help me with this?
In your case 'best' is an adverb form which is used to modify a verb.
Here's an extract from the entry in Merriam-Webster's Dictionary (https://www.merriam-webster.com/dictionary/best):
superlative of WELL
1: in the best way
: to greatest advantage
// Some things are best left unsaid.
The same thing is with 'better':
comparative of WELL
1a: in a more excellent manner // sings better than I do
b: to greater advantage :PREFERABLY // some things are better left unsaid