sobrar vs bastar
Sobrar means there's too much or some left over. Bastar means that's enough. Neighbours on the same scale.
sobrar
To be left over or to be more than needed — works like gustar.
Sobra comida.
There's food left over.
Leftovers. Also 'las sobras' = leftovers.
Me sobran dos euros.
I have two euros to spare.
What's left after paying. Gustar pattern.
Aquí sobras tú.
You're not wanted here.
Strong idiom: you're superfluous.
bastar
To be enough, to suffice.
Con una basta.
One is enough.
Short and idiomatic. Basta con + noun.
Basta con que me avises.
All you have to do is let me know.
Basta con que + subjunctive.
¡Basta ya!
That's enough!
A firm demand to stop. Used by parents and teachers.
Tricky bit
'Bastante' (quite, enough) is an adverb from bastar. 'Hay bastante comida' = there's enough food; 'sobra comida' = there's more than enough.