The hardest part is finding a suitable traffic free test venue.
Outdoor velodromes and dedicated cycle circuits are ideal.
A road-based circuit can work but you need to avoid braking if possible.
An out and back route can work but the analysis can be more difficult because of slowing down for the turns.
You need a power meter and a speed sensor on the bike, ideally a magnet-based speed sensor on the rear wheel.
You need a testing protocol so that you can collect data in a meaningful way.
You save the file, upload to Golden Cheetah, and analyse the data.
Bear in mind that power meters and speed sensors only report to three significant figures, so don’t expect the CdA to be precise to four figures. Power meter accuracy is usually quoted as one percent. What we don’t know is if that is a random one percent for every reading or if all the readings are one percent out consistently. Environmental conditions are variable day to day and on the day e.g. air density, temperature and rolling resistance. These changes need to be accounted for. Don’t expect absolute CdA values. What we are really interested in is comparisons. For example is helmet A better or worse than helmet B.