Basically, they are related to the position of the sun:
- За́хід (genitive case form: за́ходу) is from the verb захо́дити; about sun, it means 'to set', about people, it means 'to go into'. West is the place where the sun sets.
- Схі́д (gentive case: схо́ду) is from the verb схо́дити. About sun, it means 'to rise'. East is the place where the sun rises.
- Пі́вдень is literally 'midday' (пів- is 'half', день is 'day'), it can mean either 'noon' or 'South'. In the northern hemisphere, at midday the sun is in the south.
- Пі́вніч is either 'midnight' or 'North'. Of course, the sun is not visible at midnight, but it's likely that people understood mignight to be opposite to midday.