Do they just run breaking phalanx? Do they pull their front food and then crush enemies below?
What do elephants do?
Or are the fighters on top of it just shoot arrows?
Generally they were used as as shock and awe (read: point and charge) cavalry would have been. Of course, (horse) cavalry is much more versatile but did not have the same fear factor as elephants. They would sit on one flank and move to attack the side of the enemy's phalanx where they would do the most damage. Clearly, this was a dangerous tactic since elephants were prone to panic and run amok. Another formation, like at Zama, they were used in the initial phase of the battle to try to shatter the formations of the enemy's army.
Mostly, they were fear factors against the enemy army and not that useful in the battle -- although, there are a few battles where they were decisive in winning.