‘Bom’ is an adjective
Adjectives represent nouns’ attributes.
A comida está boa.
The food is good.
O trabalho não ficou bom.
The paper wasn’t good.
To describe a noun, ‘bom’ should be your choice. ‘Bom’ is commonly used to indicate quality or state of someone or something.
‘Bem’ is an adverb
Adverbs represent verbs’ attributes.
Usain Bolt corre bem.
Usain Bolt runs well.
Ela está bem cansada.
She is very tired.
To describe a verb, ‘bem’ should be your choice. ‘Bem’ is commonly use to indicate efficiency or intensity of an action.
The opposite of ‘bom’ is ‘mau (m)/ má (f)’.
The opposite of ‘bem’ is ‘mal’, which does not vary with gender since it’s an adverb.
Although both are pronounced the same, they spell differently.
A common greeting in Portuguese is ‘tudo bem’ or ‘tudo bom’, which can be either a question or an answer. In this case, they are equivalent.
That’s it! I hope it was useful for you and keep learning Portuguese.