If I were you, I would ask the teacher.

If I were you, I would ask the teacher.

I wish I could swim.

I wish I could swim.

This form is used to imagine something different from reality, such as “I am not you” or “I actually cannot swim.” It uses the past form, but it does not refer to past time.

Rule○×
Use the past form in the if-clause, and would or could in the main clauseIf I had time, I would help you.If I have time, I would help you.
Use were for be (even with I)If I were a bird, I would fly.If I am a bird, I would fly.
I wish + past form or couldI wish I could swim.I wish I can swim.

For a possible condition, use the present form + will (If it rains, we will stay home.). For an imagined situation contrary to reality, use the past form + would or could. This difference helps you tell them apart.

I wish … (“I wish it were so”) works the same way: use the past form or could after it.