Well to be honest, this could be rather difficult depending on what year of school you are in; however all good things take a little effort!
Having such a high goal is very good, but start with small goals that will lead you to the overall achievement. 4.0 is an A average and getting to that from a 1.3 (D average) may be difficult, not impossible though! Like the person above stated studying is going to be a big part of this journey. Taking alot of time to focus on bringing grades up and your schoolwork will help you in the long run. Try talking to your teacher(s) about any low grades you could bring up with extra credit or even retaking or redoing any assignments or exams you may have done less than ideal on. My biggest tip for keeping your grades up is to make sure you ask for help if you dont understand. I have found myself too many times not asking for help for a variety of reasons and I ALWAYS pay for it after the fact. Your assignments and exams directly reflect your knowledge of the subjects; if you dont understand it, then you wont do well. Another tip that will help you keep up your grades is... DON'T PROCRASTINATE! I am personally the biggest procrastinator ever; I basically do it for a living at this point. So take it from me, its never a good idea. You will always regret it and it will show in your grades. I hope this helps a little bit! Good luck!