One of the easiest ways to be productive and make the most use of your time when coding is to plan things out before you start. I have read and tried different types of time management techniques but the one that works for me the best has been time-block planning. All it involves is setting up a dedicated time throughout your day which is strictly dedicated to a specific thing, coding for example. Time-block planning is all about dedication and focus which leads to massive productivity. Trust me, give it a shot and you will thank me later!
One of the hardest things to do as a new developer, in my opinion is probably being able to allow yourself to take proper breaks. So many times, things like Twitter or other developer spaces will show you how much a person is doing with their days and it's often tough to not compare yourself to that and want to be like them. As a result, you end up overdoing it, coding 24/7 and not give yourself adequate time to rest and take breaks in between. Factor breaks into your coding or learning sessions. You will love it in the long run!