Period sex

How do you have sex when your on your period? Like I know how to have sex but is there any ways not to make such a mess? When do I take my tampon out? Ect.