Switching between characters

Hey there, I’m trying to create a Mario game where the player plays as both Mario Bros. I want to setup a button that will change control from one brother to the other and vice versa. I also want the un-used brother to follow the player with a 3 second delay. Kind of set it up like Sonic the Hedgehog 2 where Tails will follow the player around, except in this game you can play as both characters. How would I set this up and what code would I use??

THANKS!