It depends on the type of sound. You could use either limiting/compression, or a soft clipper, or a combination of both. Compression/limiting can be used to either push down longer loud passages, or to radically chop short peaks, depending on the sound sometimes you might want a combination of both (first adjust long-term dynamics toning down louder passages, then chopping the short peaks with a limiter). All needs to be fine tuned to the actual sound and its characteristics. Percussive attack peaks are often easy to fix (limiter to chop them off, or soft clipping with threshold), while slowly swelling or bassy sounds might need a different approach to sound clean. Soft clipper won’t change dynamics, but add subtle distortion.
Sometimes with recorded audio or flaky instruments one might be tempted to just render the audio track and adjust the peaks in audio editor with volume curve. Or mabye use a lookahead dynamics device.
If its really just short percussive peaks, I tend to use the compressor device, ratio to limit, attack to shortest and also a short release of only like 5-25ms, and then set threshold so it will only affect the peaks. It will add a little clicky to the peaks, but if they are short/percussive anyways it mostly doesn’t matter. Look into the compressor devices for “leveler” presets for long term adjustment, and “limiting” presets for chopping short peaks.