Define dp[i][j] as the minimum sum to reach cell (,) from (0,0). The base case: dp[0][0] = grid[0][0]. You must step on the starting cell.
For the first row, you can only come from the left: dp[0][j] = dp[0][j-1] + grid[0][j]. For the first column, only from above: dp[i][0] = dp[i-1][0] + grid[i][0]. Choosing the right state is often the hardest part. The state must capture everything needed to solve the subproblem independently.