Gauge Swatch

I have some really fine yarn and I would like to make a hat with it- but, I read that the only way to adapt a pattern to a smaller needle is to make a gauge swatch so you know how many stitches per inch. How do I even know how many stitches to put on when making a gauge swatch with no direction from the yarn ball?

For a a fingering weight yarn you could cast on 36 to 40sts, for sport weight, about 32sts. Those numbers are approximate and should give you more than 4 inches across the width. If it’s not enough to measure 4 inches across the middle of the swatch, with some extra knit fabric on each end you could measure 2 inches across the middle and double the measurements.
Does the yarn label give a weight category, sport, baby, fingering, etc?

No info at all, I bought it off Temu- although it seems to me that it would be fingering- it is very fine

You can try measuring wraps per inch although if this is very fine, maybe lace weight, that may not be definitive.
https://www.craftyarncouncil.com/standards/how-measure-wraps-inch-wpi

It may be that you just have to jump in and make a swatch with 30sts or so. Then you’ll have a starting place and be able to go up or down in needle size to get a fabric you like.
Does the yarn have a name? If you’d like you can post a photo of the label.

I recently made an initial swatch with about 30 sts and after about 10cm I just changed my needle to a different size and I did it again about 5 cm later. Each time I changed I put a removable marker in the first and last stitch. This probably wouldn’t give a swatch good enough to measure accurately from but it does give an idea of how the yarn looks and feels on different size needles, and if it’s workable on those needles.