Afflictions of WHOM?--Not of the wicked, but the afflictions of the RIGHTEOUS!--"But the Lord DELIVERETH him out of them ALL!" The Lord allows such things as tests to strengthen our faith and to get an even greater victory out of seeming defeat. Some things happen just to keep us close to the Lord--sickness, trouble, problems. Sometimes they happen to drive us closer to each other. Sometimes they happen to keep us humble. Sometimes they happen to make us pray--all kinds of reasons for even having troubles! So even troubles and tribulations are good for us.
WHATEVER God does, He does it in love.--And "ALL things work together for GOOD to them that love the Lord." (Rom.8:28) God is not going to let anything happen to you, His child who loves Him, except what is for your good. So even though "many are the afflictions of the righteous", the Lord is going to deliver you out of them all, no matter how many or what!--A-L-L, ALL!--Not just some or a few or most or many, but ALL!--All of them! So expect God to deliver you according to His Word.