Does long distance really work?

My boyfriend is moving about 2 hours away, we have been together 4 years and he is moving to attend a state university. We have committed to do long distance since its not that far but I’m still scared that it might not work. My question is, has anyone had a successful long distance relationship that has lasted about 2-3 years?