To become Lucky Friends with someone, you first have to become Best Friends. To do this, you’ll have to consistently send gifts back and forth to this friend, trade Pokémon with them, battle, or join in raids with them.

The more you do these things with the trainers in your friends list, the higher your friendship with them will be. There are four hearts that will slowly fill as you interact with other trainers, and once you’ve filled all four hearts you will be Best Friends.

Source: https://www.distractify.com/p/how-to-become-lucky-friends-pokemon-go