Bagels are just the same bread - just different in shape, but that makes no difference to your body. Therefore, you need to stop eating them. However, I got good news for you - you can follow the carb cycling diet, and it will allow you to eat them once in a while. I really like this diet because it is not restrictive, so overall you get to eat all kinds of food, and it is very easy to follow. Add to that the fact that it is effective, and you get a hella good diet that can easily be your lifestyle. Take a look at it here -
https://www.evolutionary.org/cycling-carbohydrates