This is a great question. Relative clauses can be hard, but if you know the basic principles, you will get the hang of it in no time. There are two important point to remember.
First, the case of relative pronoun (whom, who, which whose, etc.) is determined by its function in the relative clause not its function in the sentence.
Second, the antecedent of the relative pronoun matches in number (singular or plural).
In the first sentence, the correct answer is "who." The reason for this is because "who" acts as the subject of the relative clauses. The verb is "takes." In the second sentence, the answer is "whom," because it is the object of the relative clause. The subject is "the next ones" and "misfortune" is part of the object and the verb is, "strikes."
By far the most important point to remember is the first one.