After Justinian died in 565 AD, Justin II became the next Roman Emperor. But Justin and his successors could not hold the great empire Justinian had reassembled. It was too expensive to pay for all those soldiers and ships.
In 568 AD, the Lombards invaded Italy and took half of it away from Rome. Justin, short of cash, stopped paying tribute to the Sassanian king Khosrau, but that started a war in the east. By 620 AD, the Visigoths had pushed the Romans out of Spain as well.
Then during the reigns of the emperors Tiberius II and Maurice, the Avars and Slavs invaded Greece across the Danube. In 591 AD, Maurice managed to push the Sassanids back enough to stop fighting them and go fight the Slavs for a while. But he cut the pay of the soldiers, and also tried to make them spend the winter north of the Danube. It was too cold and unpleasant there. In 602 the soldiers revolted. They killed Maurice and his family, and named a new emperor, Phocas (FOE-kass).
Phocas turned out to be a terrible choice for emperor, suspicious and cruel (like Domitian). Also, King Khusro (KUSS-row) of the Sassanians used the murder of Maurice as an excuse to invade the Roman Empire again. Khusro took over all of Syria, Lebanon, Jordan, Israel, and Egypt, all the way to the Mediterranean coast. Because the Byzantines were persecuting the Jews, Jewish people may have helped the Sassanids to capture Jerusalem too. The Sassanids sacked Jerusalem and killed the people who lived there. By 610 AD the Romans killed Phocas and made Heraclius(her-AK-lee-us) emperor. He was a general from Africa.
It took Heraclius a long time to fix things up, and it was very expensive. First he made a treaty with the Avars. Then in 622 he melted down all the gold of the churches in Constantinople to pay for a massive attack against the Sassanids. The attack was successful. The Sassanids finally murdered their king Khusro, and the new king made peace with the Romans in 628.
But the Roman empire was exhausted by this massive effort. When the Arabs invaded Syria and Iraq in 633 AD, Heraclius could not defend it. By the time Heraclius died in 641, most of the south-eastern Mediterranean was in Arab hands. He left the empire to his sons, but they were not able to fight off the Arabs either.