You can do this using:
LEFT(Numbers, LEN(Numbers) - (PATINDEX('%[^,]%', REVERSE(Numbers)) - 1))
The premise of this is that you first change the line using REVERSE :
REVERSE(Numbers)
Then you can find the position of the first character, which is not a comma, using PATINDEX and pattern matching [^,] :
PATINDEX('%[^,]%', REVERSE(Numbers)) --> ,,,,,,3,2,1 = 7
Then you can use the length of the string using LEN to get the opposite position, that is, if the position of the first character that is not a comma is 7 in the inverted string, and the string length is 10, then you need the first 4 characters of the string. Then you use SUBSTRING to extract the corresponding part
Full example:
SELECT Numbers, Reversed = REVERSE(Numbers), Position = PATINDEX('%[^,]%', REVERSE(Numbers)), TrimEnd = LEFT(Numbers, LEN(Numbers) - (PATINDEX('%[^,]%', REVERSE(Numbers)) - 1)) FROM (VALUES ('1,2,3'), ('1,2,3,'), ('1,2,3,,,'), ('1,2,3,,,,,,'), ('1,2,3,,,5,,,'), (',,1,2,3,,,5,,') ) t (Numbers);
EDIT
In response to the edit, which had some syntax errors, the following are functions for trimming the beginning and trimming both sides of the comma:
SELECT Numbers, Reversed = REVERSE(Numbers), Position = PATINDEX('%[^,]%', REVERSE(Numbers)), TrimEnd = LEFT(Numbers, LEN(Numbers) - (PATINDEX('%[^,]%', REVERSE(Numbers)) - 1)), TrimStart = SUBSTRING(Numbers, PATINDEX('%[^,]%', Numbers), LEN(Numbers)), TrimBothSide = SUBSTRING(Numbers, PATINDEX('%[^,]%', Numbers), LEN(Numbers) - (PATINDEX('%[^,]%', REVERSE(Numbers)) - 1) - (PATINDEX('%[^,]%', Numbers) - 1) ) FROM (VALUES ('1,2,3'), ('1,2,3,'), ('1,2,3,,,'), ('1,2,3,,,,,,'), ('1,2,3,,,5,,,'), (',,1,2,3,,,5,,') ) t (Numbers);