About 2 years ago, I tore my left hamstring doing stiff legged deads.

It took me a long time to recover, likely because I did not properly rehab it. Today, I tore my right hamstring on the same exercise.

There wasn't as much pain as the first time but the distinctive pop was heard and I anticipate some severe pain starting tomorrow. Hopefully I didn't tear it as badly as the other.
Any advice on what I should be doing to properly rehab it? Ice, rest, what's the proper protocol? Thanks.