Partner

I’m making a platformer game and I want to make it so that a character will follow the main character like how Tails follows Sonic in the sonic series. Does anybody know how to do this?