Adjective: It describes a noun, expressing misery, unhappiness, or poor quality.
* Example: "The prisoners lived in wretched conditions."
Adverb: It modifies a verb, adjective, or another adverb, indicating a negative or unfortunate way.
* Example: "He sang wretchedly off-key."
The specific part of speech depends on its context and the word it modifies.