sill plate and rim joist air sealing
Openings and gaps in the rim joist are a major source of air leakage in many wood frame homes. Sealing the rim joist is crucial for energy savings.
Rim joists (or Band Joists) Sealing and Insulation
If you have an unfinished basement you should insulate and seal its rim joists. The rim joists (or band joists) are the beams that cap the end of the row of joists supporting a floor (or ceiling). They rest on the top of a foundation wall ( or between floors, in the case of second-floor rim joists). If you have an unfinished basement, the band joist or rim joist is the seam that sits on top of the foundation - a area particularly permeated with multiple cavities and many opportunities for leakage.That's not difficult.
Insulating second-floor rim joists requires the same steps of unfinished basements, but they pose access problems that may require tearing out the ceiling.
Using rigid extruded polystyrene to seal the band joist
The rim joist should be both insulated and air sealed.
To insulate, use fiberglass or other batt insulation material; rigid foam, namely extruded polystyrene, is also a great option...
Just cut the rigid extruded polystyrene strips to length (to fit between the joists) and use a spray foam or a good caulk to create an airtight sealing around each section.
See, for details: Insulating Basement Rim Joists by FamilyHandyman
Insulating and sealing the band joist using urethane foam
Another option to seal the trim joist is to use two-component urethane foam. This foam is sprayed between floor joists to cover all the foundation connections.
The foam will subsequently expand, filling all holes and penetrations and insulating and sealing joints and stopping air and water vapor.
See, for details: FineHomeBuilding or Insulating Rim Joist by Energy Efficient Solutions

Other Tasks
Besides the insulation and sealing of the rim joist, it's important to seal all the subfloor plywood panels, and all the holes - for plumbing, furnace pipes, heating and cooling ducts - associated to these areas.
If you have a slab or an unvented crawlspace, check the foundation for cracks and holes and seal them.
See, for details: EERE Air Sealing Report
Building codes & Sealing the Trim Joist
Pay attention to building codes. Local building codes may require you to cover the new sealing and insulation with a air barrier (drywall...).
See also:
Basics on home air leaks and their sealing
Caulking Electric
Sealing Exterior Walls
Chimney and Fireplace Caulking
Dropped Ceilings Sealing
Attic Air Leaks and Sealing
Air Sealing Bathtub Plumbing
The best of caulking and air sealing
Caulk and Sealant Manufacturers
Caulking Products
Foam Sealants
Sealing Products;
Caulking Tips
Insulation vs. Air sealing materials
Air and vapor barriers
Airtight Homes
