How can I figure out that the person with whom I perform sex is not having STD or other contagious disease?

Ask. You must ask and hope that they are telling the truth. Verifying information from other sources can help too. The surest way is to get tested yourself.