When you imagine something that isn't real (the opposite of how things are now), use if + the past form, then would + the base verb. The past form here signals "this is just imagining", not real time.
Imagining something that isn't true
If I had a million dollars, I would travel the world. (but I don't)
If I were you, I would apologize. (but I'm not you)
If we lived by the sea, we would swim every day. (but we don't)
Not "If I had more time, I will help." — say "If I had more time, I would help.". For something imagined, pair the past form with would. Will would turn it into a real, likely plan instead.
Try it: Lars doesn't speak Italian at all. He's just imagining what life would be like if he did. Which fits something he's only imagining? (If he spoke Italian, he would move to Rome. / If he speaks Italian, he will move to Rome.) Answer: If he spoke Italian, he would move to Rome. — He doesn't speak Italian, so he's imagining, not making a real plan: the past form with would (If he spoke ... he would move). The will version would mean it's a real, likely plan, but this is just a daydream.
Possible, but you doubt it
Use the same if + past, would shape for a future you think probably won't happen. It's possible, but unlikely.
If I won the lottery, I would quit my job. (I won't win)
If he called me, I would be shocked. (I don't think he will)
She would help if you asked her. (but you probably won't)
Try it: Mei is buying one lottery ticket for fun. She knows the odds are tiny and doesn't really expect to win. Which fits a win she doubts will happen? (If I won, I would buy a house. / If I win, I will buy a house.) Answer: If I won, I would buy a house. — She doubts it will happen, so the unlikely, imagining shape fits: If I won ... I would buy. The will version would sound like she really expects to win, but she's just dreaming.
Use were for everyone with be
When the if part uses be, the second conditional can use were for every person, even I, he, she and it: If I were, If he were, If it were. Both forms are in use — was is completely normal in everyday speech (If he was the boss, he'd change the rules), while were sounds more careful and is the safer choice in writing and in exams. Learn were, and don't be surprised when you hear was. The one exception is the advice phrase If I were you, which keeps were even in casual speech.
If I were taller, I would reach the top shelf. (but I'm not)
If she were here, she would know what to do. (but she isn't)
If it weren't so late, we would stay longer. (but it is late)
Not "If I was you, I'd take the earlier train." — say "If I were you, I'd take the earlier train.". If I were you is a set phrase for giving advice — this is the one place was really does sound wrong, so learn it with were.
Try it: If I ___ you, I would take the earlier train. (were / was / am) Answer: were — It's imagined (I'm not you), so you need the past form, and "If I were you" is the set phrase for giving advice — the one spot where were is clearly the form to use. "Was" turns up in casual speech elsewhere in this pattern, but not in this fixed advice phrase, and "am" would make it real rather than imagined.
Making it negative
To make the if part negative, use didn't + the base verb: If I didn't .... To make the result negative, use wouldn't + the base verb: I wouldn't .... Either half, or both, can be negative.
If I didn't work weekends, I would see my family more. (but I do work)
I wouldn't say that if it weren't true. (but it is true)
If he didn't drive so fast, he wouldn't get so many tickets.
Try it: I don't have a garden because I live in the city. Real life: "I live in the city, so I don't have a garden." Build the imagined result. (Leave out the word you don't need.) Answer: If I didn't live in the city, I would have a garden. — The if part goes negative with didn't + the base verb (didn't live), and the imagined result stays positive with would + the base verb (would have a garden). "Wouldn't" would make the result negative too and flip the meaning, so leave it out.
Asking about an imagined situation
To ask a question, put would before the person in the result part: What would you do if ...? The if part still uses the past form. A short question can be just the result: Would you help if I asked?
What would you do if you won the lottery?
Where would you live if you could choose anywhere?
Would you be upset if I left early?
Try it: ___ if you had a free afternoon? (What would you do / What you would do / What will you do) Answer: What would you do — In a second-conditional question, would comes before the person: What would you do ...?, and the if part uses the past form (had). "What you would do" puts the words in the wrong order, and "will" would make it a real, likely plan instead of an imagined one.
Real chance, or just imagining?
Choose by how real it feels. For a real, likely future, use the first conditional: if + present, will + base verb. For something imagined or unlikely, use the second conditional: if + past, would + base verb.
If it rains tomorrow, we will stay in. (a real, likely chance)
If it rained gold, we would all be rich. (just imagining)
If I finish early, I will call you. (real) vs If I finished at noon every day, I would be happy. (imagined)
Not "If I would win, I would buy a house." — say "If I won, I would buy a house.". Keep would out of the if part. The if part uses the past form (won); would belongs only in the result.
Try it: Amina has a real interview next week and a genuine chance of getting the job. It's a real, likely chance. Which one fits? (If I get the job, I will celebrate. / If I got the job, I would celebrate.) Answer: If I get the job, I will celebrate. — The chance is real and likely, so use present + will: If I get the job, I will celebrate. The past form with would (If I got ... I would) would make it sound imaginary, but this is a real plan.
Try it: Amina imagines being a famous singer, which is nothing like her real life. It's only imaginary. Which one fits? (If I were famous, I would travel the world. / If I am famous, I will travel the world.) Answer: If I were famous, I would travel the world. — She is only imagining it, so use past + would: If I were famous, I would travel. The present + will version (If I am ... I will) would mean it's a real, likely plan, but this is just a daydream.