The "If" at the beginning of John 15:18 is the first class condition ("ei" with the indicative) which
is the view point of reality making this mean "If the world hates you, and it will, keep in mind that
it hated me first."
The "If" that begins verse 19, "If you belonged to the world," is the second class condition
("an" with the imperfect) which is the viewpoint of unreality. This makes John 15:19 mean,
"If you belonged to the world, but you do not, the world would love you as its own."
These two uses of the first and second class conditional clause are confirmed by the rest
"As it is, you do not belong to the world...That is why the world hates you."
We cannot forget that even a religious system that is organized and committed to alignment
with the world will be welcomed by the world.
The Greek word for "world" is kosmos (or kosmou). Kosmos is used five times in the Greek
in verse 5:19 by John who clearly wanted the reader to have the concept of the "world" emphasized
in their reading. The word for word Greek translation for John 15:19 would be something like this:
"If you were of the world, the world would have loved its own; but because you are not of the world, but I chose you out of the world, therefore the world hates you."
The world, or the kosmos, is not referring to the earth as a planet (that would be the Greek word "ge"). The world, or kosmos, is defined by R. C. Trench in "Synonyms of the New Testament" as:
"We speak of 'the times,' attaching to the word an ethical signification; or, still more to the point, 'the age,' 'the spirit or genius of the age.' All that floating mass of thoughts, opinions, maxims, speculations, hopes, impulses, aims, aspirations, at any time current in the world, which it may be impossible to seize and accurately define, but which constitute a most real and effective power, being the moral, or immoral, atmosphere which at every moment of our lives we inhale, again inevitably to exhale,—all this is included in the aion, which is, as Bengel has expressed it, the subtle informing spirit of the kosmos, or world of men who are living alienate and apart from God."
But, it is not all hopeless since as surely as Jesus says, "If they persecuted me, they will
persecute you," Jesus also adds these words, "If they obeyed my teaching, they will obey
yours also." The "If" here is the first class condition, which is the view point of reality
the indicative mood) which means:
"If, they persecuted me, and they did, they will persecute you. But, if they obeyed my teaching, and they did, they will also obey yours."