Spend some time ensuring you understand the existing code and what it does. If after doing so you still need clarification, ask around.
Understand how code you add may affect the existing code. Look for areas that might potentially break or be affected by anything you add and be sure to test those areas when done.
Develop test cases and strategies before you start and include existing functionality in those test cases.
If you find an existing mistake, fix it, verify it, and notify your PO/Client.