You decide that you're going to run faster in some sections of your run. There's no set formula.
With intervals, you decide how long you're going to run faster (doesn't have to be flat out top speed, just a decent increase on your easy/steady pace). Then decide how many times you're going to do it. And how long a jog you're going to have between each fast bit. (BTW you can get interval timer apps you can input all your choices in to, so you don't have to remember all this stuff on your run, just listen to the bleeps and change pace)
So for example, my last one was warm up, then 3 mins fast followed by 90sec jog, done 6 times, then cool down
The longer/faster the fast bits and the shorter the jogs, the more intense the workout. You can play with the timings, so for example, you can pyramid so your fast intervals are 1 min, 2 min, 3 min, 5 min, 3 min, 2 min, 1 min all off 90sec jog breaks.
Or do it by distance - I used to run hard up the long side of a footie pitch then jog back (that's when the worst cheating about the number of repetitions I was doing would creep in big time!)
Or just play. Fartlek is where you have no plan, just decide that when you fancy it, you'll fun a bit faster. Maybe until you've passed four lampposts, or once round the duckpond, or whatever. (This is the absolute easiest one to cheat! Well, for me, anyway)