This can be a tricky habit to break! I used to have a full day from 7:30am-10
m and didn't really have any breaks to eat dinner, other than my drive from work to night classes. The only convenient place I'd pass was McDonalds, and there wasn't time to stop and get something decent. What I did was start packing snacks to take with me in advance, so I didn't have to worry about something when it came time to eat. I would prepare bags full of salad, a little bag of light dressing, fruits that couldn't get smashed, veggies to snack on- such as baby carrots, a whole wheat pita, and some chicken or turkey breast. With these items, I could make a decent dinner. They were easy enough to pack in a bag with an ice pack and just eat them as I could. It was VERY helpful to prepare these ahead of time! This can be helpful if you tend to get fast food because of a time issue.
If time isn't the problem, and it's more that the food tastes good, there are ways to help with this too. What are your favorite foods from these restaurants? Do you like hamburgers? Try making your own healthy burgers at home. I find that a freshly made (grilled) lean sirloin burger is very juicy and delicious. I enjoy them more than one from a restaurant, and I don't feel guilty. I also use whole wheat buns and healthy toppings. If I want fries, I bake my own sweet potato fries. I just slice up a sweet potato, brush it with a little olive oil and sea salt, and bake until crispy. Delicious! There are great ways (that aren't difficult) to make healthy versions of your favorite foods at home. You can look up some recipes online to get some ideas.
I still have the occasional fast food for a treat, such as while traveling, but not often at all. I notice that after I cut it out for the most part, I feel more energized. When I DO end up getting fast food, I usually feel sluggish afterwards. That feeling motivates me to not eat it for a while.