Sheldon is blowing his train whistle because he’s excited about showing some trains off to Larry once they leave the store, but Howard takes the whistle and does a magic trick with it, which enchants Larry.
When Sheldon takes Larry to Stuart’s comic shop, Howard is there so they end up hanging out with him.
As you might imagine, Sheldon isn’t happy about Larry’s newfound connection with Howard (not to mention the fact that it involves magic), but in order to make him happy, he goes with it.
In fact, Larry is so into this trick, which made the whistle disappear from Howard’s hand and reappear in Larry’s pocket, that Amy’s dad even offers Howard 100 bucks to tell him the secret.