Acyclovir is an antiviral medication primarily used to treat infections caused by herpes simplex virus (HSV) and varicella-zoster virus (VZV). It works by inhibiting the replication of viral DNA, thereby reducing the severity and duration of symptoms. Though not a vaccine, it is often used in conjunction with other preventive measures.