Basically make sure that stuff that belongs to each other is also near each other.
Best example: React. HTML, CSS and JS can all be defined in a single file. That way a button component for example can have everything it needs right at one point. They styling, the general markup and the logic in JS that the button should exhibit.