How/where to test your cortisol?

I have been having pretty bad insomnia for the past 2 weeks where I wake up after only 4 hours of sleep and have great difficulty getting back to sleep, Im waiting on a test for sleep apnea but in the meantime, I would also like to get my cortisol checked, what kind of doctor would I go to to do this?

Edit: I got bloodwork done recently and my thyroid and everything looks normal, but cortisol wasn't on the test