You pass them to the function when you call it.
When you define a function, you specify what parameters it needs to be given:
private static string pyramidLine(int lineNumber)
{
...
}
Says "when you call pyramidLine, you must give it an integer, and it will return a string".
Within the body of the function, the parameter value is stored in a variable - in this case called lineNumber - which the code of the function body can work with. This is unrelated to any other variables of that name: the function parameter is local to that function and that function only.
So when you call the function, you just pass it an integer value:
String s;
s = pyramidLine(666);
Or:
String s;
int lines = 666;
s = pyramidLine(lines);
Or even:
String s;
int lines = 666;
s = pyramidLine(lines * 10);
The value is evaluated, and passed to the function.