Clearing arduino serial buffer
If you are receiving unsolicited message (reading junk) then you could extend the bit pattern you are expecting so that there is almost no possibility of you accidentally receiving it.

Rather than 'a' and 'b' as triggers user LED="0" and LED="1".  Doing this makes reading the data much harder, because what you are looking for may start on character 4 of the string you read.  This is what I think you will need to do.


Read each character in turn and store them in a buffer until you have 7.
Is the first character an L.
If it isn't then delete the first character, shuffle the buffer left
one place and load in the next character before returning to step 1.
If it was, check the next character matches the expected.
If it doesn't match delete all character to the left and this one and return to step one.
If you have a matching token then parse it (get the 1 or 0) and do the action.