Great question! We don’t actually accelerate particles using magnets, that’s done with electric fields, but we use magnetic fields to control what the particles do and where they go. Most accelerators are ring shaped, and the magnets act to push the particles left or right, keeping them moving in a circle.
We also use magnets to focus the particle beam to a small point and to stop it “blowing up”. Lots of particles with the same charge all being close to each other is a problem, they all want to repel from each other. Magnets provide the force that counters this effect.
Finally we can use a really neat trick to shape a magnetic field so that the particle beam “wiggles” as it moves through it. This makes the particles emit light (mostly x-rays), effectively allowing us to turn our particle accelerator into a very powerful x-ray laser that lets us look inside things closely enough that we can look at how the atoms bond together!