The hook punch is done at close range; to set up an effective hook punch the distance between you and your target needs to be no farther than the length of your upper arm. It’s a powerful punch, and because it comes from the side, it may be missed by the opponent if their peripheral vision is not well-engaged.

The first step in working the hook punch is to practice it as a drill, from the H stance. Like every other punch in the punching drill, your setup includes having the striking hand at the ribs, and the cover hand by the ear (palm out).
The force in the hook punch comes from the muscles in your back, not in your arm. Once you start the punch, the arm remains relatively locked, ready to deliver force to the target. So don’t “fling” the forearm as you punch. Your final hand position will change depending on where your intended target is relative to the height of your shoulder, though.

If the target is low, strike with the palm facing in. You are still striking, ideally, with the knuckles. Forearm is level.

For a target that is roughly at shoulder level, try striking with the palm facing down. Everything else in the arm position is the same, forearm is still level.

For a target that is above the shoulder, strike with the palm facing out. Again, forearm is level. If your target is so high that you can’t keep the forearm level, you need a different punch.
Note that the best position for your hand may be slightly different, depending on your own body structure. Play with each of these positions, and note which direction of the palm feels best relative to the target. You may find, too, that there is one palm position that really works well for you. To keep that position for various targets, you can also explore different heights by varying your stance to make your torso higher or lower.
I’d love to hear the results of your experimentation with this punch – what can you observe?