In the current era of cricket, we see batsmen using switch hits to play a ball. That is, while playing a ball they change their batting side (left to right handed and vice versa) just before the ball comes to them.
This would be a No-Ball as dictated by Law 21, No ball, of the Laws of Cricket
21.1 Mode of delivery
21.1.1 The umpire shall ascertain whether the bowler intends to bowl right handed or left handed, over or round the wicket, and shall so inform the striker.
It is unfair if the bowler fails to notify the umpire of a change in his mode of delivery. In this case the umpire shall call and signal No ball.
So the bowler has to tell the Umpire which arm they will use and which side of the wicket they will bowl from. The umpire then informs the batter. If the bowler wants to change the arm or side of the wicket they must inform the umpire first, who then relays this again to the batter.