Think in "things", not "steps"
Imagine a coffee shop. You don't think "step 1: heat water, step 2: grind beans…". You think in things — a Barista, a CoffeeMachine, an Order. Each thing has data (state) and actions (behaviour). That's OOP.
// A "thing" in code is called a CLASS.
// An actual instance of that thing is called an OBJECT.
public class CoffeeMachine
{
// ── STATE (data the object owns) ─────────────
public int WaterLevel { get; private set; } = 100;
public bool IsOn { get; private set; }
// ── BEHAVIOUR (what the object can do) ───────
public void TurnOn() => IsOn = true;
public void TurnOff() => IsOn = false;
public void Brew()
{
if (!IsOn) throw new InvalidOperationException("Turn me on first!");
if (WaterLevel < 10) throw new InvalidOperationException("Refill me!");
WaterLevel -= 10;
Console.WriteLine("☕ Brewing...");
}
}
// Using it:
var machine = new CoffeeMachine(); // ← that's an OBJECT
machine.TurnOn();
machine.Brew();
Console.WriteLine(machine.WaterLevel); // 90