The airline 24-hour rule isn’t a free cancellation on every ticket
Booking direct, how soon you fly, and who sells the ticket determine whether the U.S. rule helps.
By Jake Hopkins

Check who is selling your ticket
For eligible bookings made at least seven days before departure, an airline must generally offer a 24-hour free cancellation option or a 24-hour fare hold without payment. That is not a promise that every airline offers both. The DOT requirement does not apply to bookings made through online travel agents.
Use the policy before checkout
Read the airline’s own cancellation policy and note the decision deadline. The policy on a refundable fare is not necessarily the same one you get on a basic fare. Make sure you know whether you have a hold, a reservation or a fully ticketed booking.
If the airline cancels
That is a separate refund question from you changing your plans. Keep the receipt, cancellation confirmation and exact purchase time. Use the carrier’s published instructions or DOT guidance before assuming a credit is your only option.