Treatment of pericarditis depends on its underlying cause. Common treatments include nonsteroidal anti-inflammatory drugs (NSAIDs) like ibuprofen to reduce inflammation and pain. In more severe cases, corticosteroids or colchicine may be prescribed. If an infection is present, appropriate antibiotics or antifungal medications will be used.