Phalanxes are the easiest infantry to use in a battle without taking too many losses. You need patience for they will not move quickly, and you have to think of them more as ships and mobile unites of fighters for they aren't ment to turn quick or charge an enemy. Line your phalanxes up, generally four ranks will suffice because you need that frontage more than the extra ranks. Advance as a wall will whatever more mobile units on the flanks. Move this wall to whatever part of the opposing force you want to pin down, probably the center of their infantry line, if you go chasing cavalry you will get nowhere. as you play with them you will come to the point where you can get your phalanxes in the way of the charging bodyguard of a general. But essentially the phalanxes are a movable wall which you should use to pin down opposing infantry.

Move them at normal pace and simply think out where they should be or where you want them, they aren't good at turning quickly but if you think of ship or a car always moving you should be able to navigate them through your battles.