This article explains how to clear blank lines on Google Sheets with the help of three methods. You can do this by deleting them one by one, applying a filter or installing an add-on that can delete empty rows and cells.
Steps
Part 1 of 3: Deleting Lines One by One

Step 1. Go to https://sheets.google.com from a web browser
If you are logged in to Google, the page offers you a list of Google Sheets documents associated with your account.
If you haven't already, log in with your Google account

Step 2. Select a Google Sheets document

Step 3. Right click on the row number
The latter is indicated in the gray column on the left.

Step 4. Click Delete Row
Part 2 of 3: Apply a Filter

Step 1. Go to https://sheets.google.com from a web browser
If you are logged in to Google, the page offers you a list of Google Sheets documents associated with your account.

Step 2. Select a Google Sheets document

Step 3. Click and drag the mouse cursor to select all data in the sheet

Step 4. Click on the Data tab
It is located in the top menu bar.

Step 5. Click Create a Filter

Step 6. Click on the green triangular icon with three lines, located in the upper left cell

Step 7. Click on Sort A → Z
This has the effect of moving all empty cells to the bottom.
Part 3 of 3: Install an Additional Component

Step 1. Go to https://sheets.google.com from a web browser
If you are logged in to Google, the page offers you a list of Google Sheets documents associated with your account.

Step 2. Select a Google Sheets document

Step 3. Click on the Add-ons tab
It is located in the top menu bar.

Step 4. Click Install Add-ons

Step 5. Enter Remove Blank Rows in the search box and press Enter

Step 6. Click + Free
The button is located to the right of the add-on name "Remove Blank Rows (and More)". The associated icon is that of an eraser.

Step 7. Click on your Google account
If you have more than one, the installer will ask you which account to associate the add-on with.

Step 8. Click Allow

Step 9. Click the Add-ons tab again
It is located in the top menu bar.

Step 10. Select Remove Blank Rows (and More)

Step 11. Click Delete / hide blank rows / columns
This action opens a dialog with add-on options on the right of the screen.

Step 12. Click on the blank gray cell in the upper left corner of the spreadsheet
This selects the entire worksheet.
You can also press the key combination Ctrl + A to select everything

Step 13. Click Delete
The button is located at the bottom of the dialog box with the "Remove Blank Rows (and More)" component options.