Recording Your Work
Keeping good records of what you have done and why you did it that way is an important part of doing research. While you are in the middle of doing research, it may seem a bit redundant to do this. As soon as the summer ends, however, you will quickly start to forget the finer details of what you did. Future you will be very grateful for the detailed notes when it comes time to prepare for your poster at the AAS meeting next January. At the beginning of the summer you should start a notebook (either handwritten or digital) that contains notes on everything you do. This includes notes from meeting with your advisor, summaries of the seminars you attended, and notes you take while reading papers.
Commenting Your Code
Writing comments in your code is just as important as keeping good research notes. These should be brief descriptions of what a code does at different points or what a variable stands for. You don't need to write a novel about each step in the program, but a few words will greatly help you to understand your code. Regardless of how long its been since you last looked at you code, you will be able to know what it is doing with ease if your code has comments.
Asking For Help
Remember that you are here to learn, and you are not expected to know everything. Utilize the knowledge of your advisor, other members of the department, and your peers to help you in completing your project. If you get stuck, ask for help. When you go to your advisor with questions, it shows them that you are thinking critically about your project and that you are invested in your own education. If you think that you have a small question that one of the grad students can answer, see here for a list of grad students that are happy to help.
Time Management
Astronomy research is a job with a structure unlike the average 9 to 5. The hours are flexible, the work can usually be done remotely, and meetings with supervisors happen infrequently. Because of this, it will require discipline on your part to get your work done and participate in all of the scheduled seminars, meetings, and workshops throughout the summer. You are expected to work 40 hours per week. It is recommended that you treat this like a 9-5 job and keep hours accordingly. You should notify your advisor if you plan on missing a day. If you keep regular hours, you will be in the office when your advisor is, and you will be in the department for meetings and to get any questions answered.