Place a humidifier in the room. The increased moisture in the room is absorbed partially by the wood, laminate or particleboard flooring, causing the boards to expand and reduce gaps.
Increase the temperature in the room with a heater. This also helps flooring expand, and you get a better idea of how severe the gaps are when the floorboards are at their maximum size.
Repair any existing leaks under the sinks or in the pipes near the flooring. While increased humidity helps floorboard expansion, excessive water from leaks results in warping that increases the space between boards. Tiles are not usually affected by this the way wooden boards are, but excessive moisture may damage caulking and lead to gaps.
Apply wood putty to any gaps that are still present in wood, laminate or particleboard after the boards are expanded. Smooth the putty with a trowel and allow it to dry. The putty should be as close as possible in color to the floor, which makes the repair less noticeable.
Dig out any old caulking between floor tiles that have gaps by using a razor blade to scrape it loose. Apply fresh caulk to each gap using a caulk gun. Thicker ceramic tiles often use mortar, which is applied with a trowel. Fill the gaps, wipe away the excess with a rag and allow the mortar to dry fully. The mortar both fills in the gaps and holds the tiles in place.