What happens when someone quits in the middle of a swiss tournament? 5 rounds of a Swiss Style Tournament passed and a person who was second in the table quit (withdrew). What should we do? What about points others earned wining him? What about people who lost against him? And what about his future games?
The General handling rules for Swiss Tournaments published on the FIDE website merely say:


  
  Players who withdraw from the tournament will no longer be paired. 
  


The rules don't say that he/she can't be included in the final ranking (unless the additional rules for the tournament say the contrary, I suppose). 

The points that his/her opponents won should remain valid. (How to deal with ties between opponents in the final ranking - that is unclear to me.) 

It is not clear why leaving a tournament should affect a player's future games, unless there are regulations that apply to a cycle of tournaments. For example, for the Regulations for the 2016-2017 FIDE World Chess Grand-Prix Series contain the following rules:


  4.5 If a player withdraws from an event after completing 50% or more of the games, the rest of his games are lost by default. Unless a withdrawal is justified by serious injury or illness, he will forfeit his right to the prize for the tournament and be excluded from the rest of the World Chess Championship cycle. 
  
  18.3 Should a player withdraw from a tournament or the Grand Prix Series without proper justification to the WCOC, then an automatic penalty of €5,000 will be imposed by FIDE on the player and the player may be excluded from the next World Championship cycle. 


For official FIDE competitions (not all tournaments fit this category), the following rules from the FIDE Tournament Rules (version from 2011) also apply: 


  5 (c) If a player withdraws, is excluded from a competition after the drawing of lots but before the beginning of the first round, or there are additional entries, the announced pairings shall remain unaltered. Additional pairings or changes may be made at the discretion of the CA in consultation with the players directly involved, but only if these minimise amendments to pairings that have already been announced.
  
  9 (b) When a player withdraws or is expelled from a round-robin tournament, the effect shall be as follows:
  1. If a player has completed less than 50 % of his games, his score shall remain in the tournament table (for rating and historical purposes), but the points scored by him or against him shall not be counted in the final standings. The unplayed games of the player are indicated by (-) in the tournament table, and those of his opponents by (+). If neither player is present this will be indicated by two (-).
  2. If a player has completed at least 50 % of his games, his score shall remain in the tournament table and shall be counted in the final standings. The unplayed games of the player are shown as indicated as above.
  (c) If a player withdraws from a Swiss-system tournament, the points scored by him and by his opponents shall remain in the cross-table for ranking purposes. Only games that are actually played shall be rated.