I’ve read that Salah keeps you away from sinning. Although I keep repeating the same sin while trying to avoid it and I try pray my Salah properly. Does this mean my Salah isn’t accepted?

The prayer that forbids indecency and wrongdoing is the accepted prayer that the servant performs with sincerity and directing to God Almighty, and observing God Almighty that He sees Him.
If you happen to be watching over God Almighty and He is aware of you, you will be ashamed of Him to commit disobedience while He sees you.