No matter what you hear, carbs themselves won’t make you fat. Weight gain is a result of over consumption of large portions of any type of food or being in a constant caloric surplus. So you can still eat starchy food like rice, potatoes, and pasta but in moderation.
It should be noted, however, that some carbohydrates are better for you than others in terms of nutrient-content. Whole foods like greens, fruits, and whole grains will always be better for you than food loaded with refined sugars like chips and pastries.