What's the best way to correct buckled track?

I would cut out a 6" section or more (good time to get rid of one of those short straight sections) and relay it, using joiners without solder on one side at least. I soldered my first brass tracked HO layout about 40 years ago to solve some power problems I was having, and it helped tremendously. When I built my first N layout, I glued, ballasted and soldered every single joint, and never had a single problem during it’s 4 year lifespan. When I redid it, and greatly enlarged it to three 4x8 sheets of plywood, I had my mains pop off the ties near a seam about a week after I had glued it down. Since I hadn’t started to ballast it yet, it was an easy fix. I haven’t laid a single piece of track yet, but this time I will put a few expansion joints in.
So far, all Ive done is clean up a few of the used locos I bought on Ebay, and tested out the new ones to make sure they all work. So far, even the junkers run ok, except for an older brass SD-40 loco that has a dud motor. I already have a Kato motor to stick into it, and once it’s running, it should be a great puller with 12 wheel drive and all that weight.