"'For I will give the command, and I will shake the people of Israel among all the nations as grain is shaken in a sieve, and not a pebble will reach the ground.'" NIV translation
God has preserved a remnant of His people from the very beginning. A sieve is used to separate rocks and debris that was picked up with the grain from the ground. As the sieve is shaken back and forth, the grain which is smaller passes through the sieve but the rocks and other things will not. That is a picture of God setting apart a people to call His own. We notice that it is the humble (smaller) things that pass through the trials (sieve). The proud (rocks) cannot make themselves smaller to sneak into the kingdom and the humble (grain) do not cling to the world (sieve). They have faith (trust) in God to catch them and preserve them for all time.
"'All the sinners among my people will die by the sword, all those who say, "Disaster will not overtake or meet us."'" NIV translation
The "sinners" among God's people refers to those that do not trust God and the truth of His word.
There were false prophets that were telling the people that everything was gonna be alright.
The same type of thing is happening today as many people that are "in the church" do not believe in the Word of God. When the time comes, they will be sifted out and will perish.
"'In that day I will restore David's fallen shelter - I will repair its broken walls and restore its ruins - and will rebuild it as it used to be, so that they may possess the remnant of Edom and all the nations that bear my name,' declares the Lord, who will do these things." NIV translation
This remnant will rule and reign with Jesus Christ. David's fallen shelter refers to Jerusalem and we are reminded of the New Jerusalem described in Revelation 21. Edom was the brother of Jacob and an enemy of Israel but all nations will finally be at peace with Israel. This peace will only come through Jesus Christ and people in submission to His leadership.