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 cavalry would have been. 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 battle where they were decisive in winning.