The steps to fit the cells in Google Sheets:
Open the Google Sheets file.
Select the cell(s) for which to adjust the text wrapping settings.
Click the Text wrapping button in the toolbar.
Choose the desired text wrapping option.