There are a few of solutions you could try...
First, you might consider letting your remaining two players each pick up and run one of the characters of the departed players.
This is simplest, although it will require a little more work and involvement on the part of the other players. The most difficult thing will be roleplaying these characters, though they can focus their roleplaying on their own characters if they wish. As a secondary option, if the players prefer, you could allow them to roll up a couple of new characters of appropriate level and each run two PCs that way.
Alternatively, you, as DM could run the abandoned PCs as NPCs.
This is less desireable bacause it is more work on you the DM, and you already have a lot of work on your hands, but it's doable. Let the players suggest moves in combat, but if you are running the characters as NPCs, you have final say. Again, you could introduce new characters in lieu of the departed players' characters.
Another option is to modify the challenges so that two PCs can handle them.
This is some work, but since you are not inexperienced, you should have some idea how to do this. Often it will be a matter of cutting the number of monsters in half, but some bigger monsters will need to be nerfed a little bit. A lot will depend on the classes you have left--is the party now without a fighter? Did they lose a wizard with area of effect spells? Also, don't forget to make the non-combat challenges doable for the remaining characters. If one of the departing players was running a rogue, you might need to dumb down the traps a little, or eliminate them altogether. Challenges where a cleric is kind of necessary should also be altered if the party is now without a cleric, etc.
Or you could give the remaining two characters a level boost.
Consider boosting your remaining PCs a level or two, which may allow them to meet the challenges with just two. Suggest they take a level in one of the classes the party has lost to get some of those skills and abilities back. This can be tricky, and you shouldn't jump them up too high. A lot will depend on their classes and their skill as players.
A variation on this theme would be to toss the PCs more, and somewhat more powerful magic items than maybe you normally would. The best method for doing this would be to give them single-use items tailored to specific encounters (e.g., potions of resist cold and a scroll of fireball or flame strike when you know they'll have to face a white dragon). A bit better weapon or weapons with damage bonuses (like flame tongue) also will help the party in combat.
And of course there are always more players in the sea...
This might be a great opportunity to find new players in your area, if you're up to doing so. Maybe you (or one of your players) have some friends who don't play, but maybe would like to give it a try. Maybe there are some players nearby who want to find a game, but have had trouble. Ask around at the local game shop if there is one. It's not always easy to jump into a game mid-campaign, but new players especially might just be happy to give it a try.