How to "fake" a button press through code?

I think the question is pretty self explanatory, I usually give details as to my specific situation but I’m not sure I could explain it without just making things overcomplicated. Basically, I want a line of code that could “simulate” a button press. As in, for example, when the game starts I want Unity to think that the player just pushed the left alt key, but he actually didn’t. It would be hard to explain why I want this, but really there is no other way to achieve what I am looking for. If anybody knows of any code that could do this, or any way at all to trick Unity into thinking the player pushed a button, I would appreciate it very much. Thank you in advance for any help.

Well I’m thinking that maybe you could make the instructions that get executed on button press into a method, and then call that method where you want to fake a button press.

Or you could have the button press trigger a bool, which triggers the code- then to fake the button press you would simply toggle the bool.

The info you get straight from Input is strictly read-only as far as I know, but there are many other ways that you can trigger code to execute.