Hydroxychloroquine is a medication primarily used to prevent and treat malaria. Additionally, it is utilized in the management of autoimmune diseases such as rheumatoid arthritis and systemic lupus erythematosus (SLE). The drug functions by modulating the immune system and has anti-inflammatory properties.