Xofluza (baloxavir) is used to treat and prevent influenza A and B. It’s most effective when taken within the first two days of flu symptoms. Xofluza works by blocking the formation of new flu virus particles, helping your immune system fight the infection more efficiently.