The input of every transaction refers to an output of a prior transaction.
An input can't be defined by only the transaction hash. A transaction consists of 1 or more outputs if you only specify the transaction hash there is no way to know which output is being spent.**
Since these types of questions often come from a larger misunderstanding of how the network "really works" I am going to start with some "plain english" rules on transactions (tx):
1. A tx consists of one or more inputs and one or more outputs.
2. All tx inputs refer to an unspent output of a prior transaction.
3. The full value of an input is always spent; a tx can not spend part of the value.
4. Likewise all outputs are either spent or unspent, they can't be partially spent.
5. A tx "spends" the outputs which are referenced in the input portion of the tx.
6. A tx creates new spendable "unspent outputs" listed in the output portion of the tx.
Now that we got that out of the way, to define a tx input you need to refer to the hash of a prior transaction AND the output index. The tx hash identifies the transaction, but the transaction may have more than one output so the index is used to identify which output is being "spent" here.
This may seem confusing because you will hear statements such as "I have 20 BTC stored at address 1XYZ..." or "My wallet had 100 BTC", but this is really an abstraction. The client is merely showing you the sum of all the unspent outputs for an address or the entire wallet.
The Bitcoin network works on the concept of inputs and outputs
The Bitcoin network doesn't consider the "value" an address when validating txs. When validating a tx, outputs are considered as independent entities. Spending one output for a particular address has no effect on the other outputs (if any) for that address. A transaction is valid (among other things)if all the inputs refer to valid unspent outputs of prior transactions (can't spend coins twice), the sum of the outputs is less than or equal to the sum of the inputs (can't counterfeit new coins), and the inputs are signed by the correct private key (only the "owner" of the private key can spend the coins).
To avoid a lot of excess detail we will look at a simplified version of the transactions used in the Bitcoin network.
Say an previous transaction exists (tx hash 1234567890). In this transaction you have an input which referenced an unspent output of a previous transaction worth 100 BTC. You send 50 BTC to one address, 10 BTC to another address, and the change (40 BTC) is sent to a new address in your wallet. Remember we can't spend part of an unspent output so the change is necessary because we are spending a 100 BTC input but only need to "send" 60 BTC.
The simplified pseudo-transaction may look something like this.
In <lets ignore the input for now but it does have a value of 100 BTC>
Out Bitcoin address=1ABC... Value=50 BTC
Out Bitcoin address=1DEF... Value=10 BTC
Out Bitcoin address=1XYZ... Value=40 BTC
The tx has 1 input, 3 outputs, all in/out indexes are zero based, and the value of the outputs is equal to the value of the input. If the output(s) are less than the input(s) then the difference is the fee paid to the miner. If the outputs are more than the input(s) then the tx is invalid.
Now since the "change" address is 1XYZ is another address in our wallet we can use it in a new transactions. We will pay a merchant 1 BTC and give the miner a fee of 0.01 for fast inclusion in a block. The change will be sent to yet another new address in the wallet (1ZZZ....). The resulting transaction may look like this:
In Tx hash=1234567890 OutputIndex=2
Out Bitcoin Address=1HIJ... Value=1 BTC
Out Bitcoin Address=1ZZZ... Value=38.99 BTC
The input refers to the 3rd (0 base array) output of the tx above. Looking up the output index 2 of tx 123456789 we can see the value is 40.00 BTC. The sum of the outputs are 39.99 meaning 0.01 BTC will be collected by the miner of the block.
Real txs deviate from the simplified version shown above
Note this isn't really important unless you want to dive deeper into the workings of the protocol. The output of Bitcoin transactions are actually scripts instead of static addresses and values shown above. Functionally for most outputs they work the same, although to save space the hash of the public key not the address is used in the output. All blocks have a required tx called the coinbase which has no input because the output is the block subsidy and the fees paid to miners. All values in the Bitcoin network are integers in Satoshis (1E-8 BTC) so technically all the numbers in this post would be multiplied by 1E8.