It can definitely work out! Just depends on who's in the relationship. If you two love eachother enough and are willing to put in the effort and are in it for the long run, it can definitely work out. It won't be easy, some days will just fly by, other days .... LOL other days will definitely be a challenge :( but as long as you two have something to look forward to (ex. 1 month until you guys see eachother again) and as long as you communicate (VERY IMPORTANT) and there's trust and both of you are 100% serious about it, it'll work out, trust me
It won't work out for everyone but for the few that are willing to put in the extra work because they know in the end it'll be worth it .... it def will
Source: Been in a long distance relationship for 2+ years now and everythings working out
Goodluck!