Hat Yai is a city in southern Thailand.
When walking from the train station follow Tamnoonwithi Rd, continue out of the city and then walk over a bigger road. Turn right on the next bigger road which should have signs for Sadao, which is the border town. It is not difficult, you can always ask local "Malaysia?" and point to both directions and see what they say.