SLC is usually cheapest but is about 5 to 5.5 hours from the parks.
I assume you will be including a day or two in the Grand Tetons as well as Yellowstone.
Jackson is right at the Grand Tetons.
Bozeman is about 1.5 hours north of Yellowstone.
West Yellowstone is at west entrance.
Billings is about 2.5 hours from Yellowstone.
Idaho Falls is about 1.5 hours from the Grand Tetons.
Cody is about 2 hours from Yellowstone.
Always compare total flight time with connecting flights. Also compare car rental costs before you book airfare.
We often fly to SLC because of cheaper car rentals and also unless direct flights the connecting flights are about the same.
You must have reservations if this trip is for this year!!
Do not just show up and think there will be lodging in the parks or in the gateway towns.
Timing is also important. Late May to mid September are best times to visit imo.