Fischer to Haworth projection: which carbon connects to the oxygen?
It just is. There are pyranose and furanose forms for all aldoses and hexoses (given they are long enough), including glucose:

$\hspace{3cm}$

You will just have to remember which connections correspond to which sugars. You can read more about anomers ($\alpha$ vs. $\beta$) here, and more about carbohydrate chirality (D vs. L) here.