This is one of the most common questions I get about the IELTS writing test, after all it is a common concern and it is a good question to ask. There are 3 ways to look at this concern; I just focus on one task (make sure it’s an extremely good piece of work) and not attempt the other task; I attempted both task 1 and 2, then end up not finishing both; I finish one task and not finish the other.
Although I would agree that the second task does have a heavier bearing on the total score, and scoring well on that task will certainly boost your total score; I will not advice devoting the whole hour to try and make sure that you will come up with “the best” task 2 that you can.