I have difficulty knowing when my period is over. I’m afraid to be too early and pray while still menstruating. I’m also afraid of not praying if I really am done. How can one be certain?
Is it better to wait and be completely certain or should I pray in case I am done (make ghusl twice if neccessary).

Last time I made ghusl, prayed and I saw bleeding just after I thought I was finished.
Its all really difficult.

When in doubt if you've finished your period or not, you can check using a bit of cotton or tissue my inserting it just into the mouth of the vagina. The method described is to squat a bit and insert the piece of tissue or cotton and stand up and after a few seconds remove the cotton. If it has blood on it either red or dark brown then your period is not over (apologies for being very open but it's necessary for these rules to be understood).

If you see that there is no blood, then you can do ghusl and pray. Sometimes however it is possible that the blood will stop completely and then a small amount maybe discharged the next day. In this case, you just need to check again and if clean do your ghusl.