Move Selection with First Transient to Nearest Beat
Align selections to the beat.
Use beat mapping on audio regions in Logic Pro — Apple Support
In Logic Pro, Control-click the beat mapping header, then choose Move Selection with First Transient to Nearest Beat from the shortcut menu (or use the corresponding key command).
The first transient marker in the region selection is moved to the nearest whole beat position, with all selected regions moving with it.
Logic Pro beat mapping overview — Apple Support
When Advanced Editing Options is selected in the Advanced preferences pane, you can access the Beat Mapping track. Beat mapping lets you map notes that don’t follow a strict tempo with beats in the ruler. When you play the project, the project tempo adjusts so that the beat-mapped notes are aligned with beats in the ruler.