The windmill can be a little confusing to learn how to use when it's first unlocked, so it's normal that you aren't quite sure how it works. To use it, please put some kind of grain into the middle level of the windmill to be milled.
Next, go to the top floor of the windmill and interact with it. This will lock you in place, so Stella will no longer be able to move until you finish the interaction by cancelling out. To use the Windmill, you need to move the part Stella is interacting with up and down so that the pointer on the side is inside the open space. When the Windmill starts to spin, you'll know it's working properly.
Please note that the pointer will move depending on the time of day, location, and speed of the ship, so you may need to check back in to readjust again to make sure it's working.