If your turtle is pacing back and forth, there's a good chance they're bored. Boredom is often the result of a lack of stimulation, so the key to preventing it is to provide your turtle with plenty of things to do.
There are many ways to keep your turtle entertained and engaged. Try offering them a variety of different toys, such as balls or chew toys. You can also create an obstacle course for them to navigate or hide their food in different places around their enclosure for them to find.
If you provide your turtle with enough interesting things to do, they'll be much less likely to become bored and start pacing around their home.