Since you are a learner driver, just do this for now, later on you'll become more confident in driving and you'll be able to make the right decisions, for now, as you approach the traffic light start braking slightly, even if it's green, that way if it turns yellow, you're already slowly slowing...