In Illustrator 2025, you select both items, then choose the "Align to Key Object" grid icon (hi-lighted in yellow in the attachment) from the Align Palette, then click on which object you want to be the key, it will outline in blue, then choose how you want them to align.