Vastu Shastra and Jyotish Shastra are part of Apara knowledge and can be truly understood, only after realizing Brahman Gyan or Atman gyan, not through modern extroverted material science.
Saunaka, having asked – कस्मिन्नु भगवो विज्ञाते सर्वमिदं विज्ञातं
भवतीति (" Revered Sir, what is that by the knowing of which all this
becomes known? "), - was told by Angiras that –
द्वे विद्ये वेदितव्ये इति ह् स्म यद्ब्रह्मविदो वदन्ति परा चैवापरा च |
तत्रापरा ऋग्वेदो यजुर्वेदः सामवेदोऽथर्ववेदः शिक्षा कल्पो व्याकरणं
निरुक्तं छन्दो ज्योतिषमिति | अथ परा यया तदक्षरमधिग्म्यते || - (Mundaka
Upanishad I.i.3-5)
there were two different kinds of knowledge to be acquired – 'the
higher knowledge' or Para Vidya (Sanskrit: परा विद्या )and 'the lower
knowledge' or Apara Vidya. The lower knowledge consists of all textual
knowledge - the four Vedas, the science of pronunciation etc., the
code of rituals, grammar, etymology, metre and astrology. The higher
knowledge is by which the immutable and the imperishable Atman is
realized, which knowledge brings about the direct realization of the
Supreme Reality, the source of All. The knowledge of the Atman is very
subtle; it cannot be obtained out of one's own effort; the Atman
cannot be intuitively apprehended by mere intellectual equipments.
Thus, Angiras draws the distinction between the way of knowledge and
the way of realization, as between opinion and truth. For
understanding this for realizing the Reality the aspirant must seek a
teacher. The teacher who has already realized his identity with the
Atman alone can impart this much sought-after wisdom on the strength
of his own experiences.
Anyways, in layman terms, Vastu Shastra is based on 5 elements or Panch bhuta :- Space, Air, Fire, Water and Earth, which are the core of entire universe. Just like recent inventions of mobile phones, computers and other electrical appliances have a fixed way of working with electricity, charging and containing predefined applications/operations, similarly this projected Maya or universe has basic fixed rules like Sun will always rise in East and sets in West. Since, Sun rises in East, therefore most of sunlight shines and radiates in Northern and Eastern side of a house, thats why according to Vastu, bedroom should be build in Southern or Western side, as sleep is possible only at night and darkness and Sun is weakest in the Western direction and therefore that region of house(South-West) is best for master bedroom.
Use of house's different directions for different purposes like NE for house temple, SE for kitchen actually comes from zodiacal belt of 27 constellations/Nakshatras as explained in Vishvakarma Prakash. So, to truly understand Vastu Shastra, Jyotish Shastra should be studied parallelly. For example, house temple is recommended to be constructed in North-East of house because directly above it(for any plot) in the sky lies the Kritika constellation which is the first constellation of zodiac belt and represents small Fire/Agni(personified as Kartikeya/Murugan in temples) as the beginning of the Universe. Similarly, bedroom is recommended to be built in the South direction because directly above is the Uttara Phalguni constellation which is symbolized with bed and is in middle of Fire(Passion)-Earth(Sleep) elements, dominance of these two basic elements are necessary for any common man to function properly in earthly society. Medicines should be kept in NNE of house to improve their efficiency as directly above it is the Ashwini constellation, which is personified as Ashwini Kumaras, the healer doctor Gods. Washroom with water(not Toilet) should be built in Eastern direction, because above it in sky is the Ardra Nakshatra which is personified as Rudra God(full of tear rains). Toilet should be build in SSW as above it is the Swati nakshatra(ruled by Vayu). Churning equipments like washing machine or motors should be placed in ESE direction i.e. below Ashlesha nakshatra(ruled by Nagas) which represents snakes and thats why Vasuki snake was used to churn ocean during Samudra Manthan.
Construction of wrong things at wrong directions lead to catastrophic effects over long terms like building toilet(representing Rahu) in North-East(head of Vastu Purusha) can lead to brain diseases and insomnia, building kitchen in North-East can lead to anger issues or high bp problem in one or more than one person of a family living in a house made with wrong Vastu.
So, in conclusion Vastu Shastra and Jyotisha Shastra are controlled by 33 Vedic Gods i.e. 28 static Purusha Nakshatra Gods(including Abhijeet nakshatra)+ 5 dynamic Prakriti elements/planets(Space(Jupiter), Air(Saturn), Fire(Mars), Water(Venus) and Earth(Mercury))