Now, both formulas are meant for different conditions.
When there is no acceleration (a=0), that is speed is constant, and body is initially at rest,that is there is no initial velocity (u=0), then you can use
speed= distance/ time.
When there is acceleration(a), or if body has initial velocity (u), then you cannot use above equation. Now, you should use v=u+at.
Whether or not to use an equation depends on the data you have, and what is provided in the question. You will have to read question carefully to find out what equation to use and what to avoid.