How do i stop a coroutine from dying?

I’ve tried using coroutines in my scripts, and i’ve been using coroutine.wrap() when scripting due to not being able to make normal coroutines come back to life, and that hasn’t been working (coroutines just coming as dead), so i was wondering if anybody could enlighten me with knowledge on how to fix this.

(i know there’s another post just like this but i cant understand the garbled code in the solution, so im wondering if somebody else can provide a good solution here without me reviving a post over a year old)

local routine = coroutine.create(function()
	print("hello1")
	coroutine.yield()
	print("hello2")
end)

coroutine.resume(routine) --hello1 displayed
task.wait(5) --wait 5 seconds
coroutine.resume(routine) --hello2 displayed

You can just create a new coroutine when you want to run it again:

local function DoSomething()
  print("Something")
  task.wait(1)
  print("After wait")
end

local function DoSomethingInACoroutine()
  coroutine.resume(coroutine.create(DoSomething))
end

DoSomethingInACoroutine()
DoSomethingInACoroutine()

-- Something
-- Something
-- After wait
-- After wait

Thank you! An incredibly simple solution, and it worked out!