Once you've opened your Google Sheet, highlight a row or column by clicking on its corresponding number. (You can select multiple rows and columns by holding shift when you select the rows or columns.)
- Go to View.
- Select Freeze.
- Choose Up to current row to select all rows up to the one chosen.
It's the same process for freezing columns. Just select Up to current column. By default, Google Sheets sets the frozen rows and columns to the top and left, respectively.