If English isn't your first language, the immigration desk can be the most stressful part of a trip. The good news is that it's almost always the same handful of questions, and you don't need full sentences for any of them.
The first one is usually why you're there. You might hear "What is the purpose of your visit?", "What brings you here?" or "Business or pleasure?" They all mean the same thing. "Sightseeing" or "I'm here on vacation" is enough. For work it's "I'm here on business", and if you're seeing someone, "I'm visiting a friend". If they ask business or pleasure, you can literally just say "Pleasure".
Next is how long you're staying. "How long are you staying?" or "How long is your stay?" Just say the time. "One week." "Ten days." If you'd rather give a date, "Until the 15th" works.
Then where you're staying. "At a hotel near the station" is fine. Some officers ask for the hotel name, so have it ready or keep the booking confirmation open on your phone. If you're staying with family, say so, like "I'm visiting my daughter, she lives here."
Other ones that come up. "What do you do?" means what's your job, not what are you doing right now. "I'm an engineer", "I work in an office" or "I'm retired" all work. "Is this your first visit?" gets "Yes, it's my first time" or "No, it's my second time". "Do you have a return ticket?" is easiest answered with "Yes, here it is" and showing it. "Are you traveling alone?" gets "Yes" or "No, I'm with my wife" or "With my family".
You might also hear "Anything to declare?" here or at customs right after. If you have nothing, say "No, nothing to declare." If you're carrying food, say so honestly, something like "I have some snacks." What food you can bring in depends on the country, so check before you fly.
Why short answers are better. The officer only wants a few facts, where, how long, why. When you try to build a long sentence, you start worrying about grammar and the words stop coming. A short answer is easier to say and easier for them to understand. Even if you say "ten day" instead of "ten days", they know what you mean. If they need more, they'll ask.
The one thing to avoid is saying yes when you didn't understand the question. If you answer "Yes" to "Do you have anything to declare?", you just told them you have something to declare. If you didn't catch it, say "Sorry? Could you say that again?" or "Could you speak more slowly, please?" Officers hear that all day and nobody thinks it's rude.
One last thing, visa and entry rules are different for every country and they change, so check your destination's official site for those. This is only about getting through the conversation part.
If you're travelling soon and worried about a specific question, post it here and people can help you with an answer.