Dexamethasone is a corticosteroid which has anti-inflammatory and immunosuppressant effects.
The steroid may be used because of damage in Trump’s lungs and/or circulatory system. Doctors reported his lungs have been attacked by the virus and he needed supplemental oxygen. Indications are he is suffering well documented inflammatory symptoms of the disease wherein the body’s own immune system (white blood cells) are breaking down and attacking healthy cells in the lungs and blood capillaries throughout his body. This steroid stops that but also weakens his immune system’s ability to fight the virus.
Per Wikipedia:
The World Health Organization (WHO) states that dexamethasone should be reserved for seriously ill and critical patients receiving COVID-19 treatment in a hospital setting,[59] and the WHO Director-General stated that "WHO emphasizes that dexamethasone should only be used for patients with severe or critical disease, under close clinical supervision. There is no evidence this drug works for patients with mild disease or as a preventative measure, and it could cause harm."
Remember that (Linus Pauling famously suggested) Vitamin C has a strong anti-inflammatory effect on the body without the damaging effects of steroids. It is impossible to overdose on Vitamin C which shows just how important this vitamin is for the human body. But like any vitamin and minerals, it’s effects on the body can only be built up over time. They are not magic bullet drugs but aid your body’s innate ability to fight dangerous pathogens and maintain healthy homeostasis.