When you first run into the sawmill, you need to leave your ship and head up the funnel blocking your path. A switch inside the building at the top will move the blockage, but it breaks as soon as you use it. You need to get the repair box on the next floor up to fix it, but you can’t jump that high.
Go out onto the open platform to the right of that first room. There’s a button you can jump to hit that will cause the saw above to try to cut the wood. However, you need to use the nearby lever to move the wood into place first. Next, position the wood so that the saw can cut through the middle of it, the point between the two pieces of metal. Then, hit the button to saw the wood in half.
A piece of wood will fall to the floor in front of you. Use the apparatus nearby to scoop up the wood and drag it into the first room you entered. Then, you can jump on the wood and get up to the floor above, where the repair box is.
Grab that repair box, come back down to the broken lever, and hold the box while standing near it. This will automatically repair the lever, allowing you to use it and free your ship. This puzzle teaches you how to repair things on your ship, and it’s worth bringing the repair box with you back to your ship, so you’ve got it when you need it.