How are you powering the servos? If they are connected to the Arduino 5V pin then that's your problem. Servos should be powered separately NOT through the Arduino. A circuit diagram would help us see what's going on.
If you think it's not that, try putting back in all of the code lines except the myservo2.write(). Does servo1 still work correctly? If it does put the lines back in one at a time from the bottom until it stops working then report back.
If that doesn't show anything perhaps you could give a more useful error report than "messes up everything". E.g. what actually happens or doesn't happen?
Steve