This depends on what you are designing primers for. For targeting a specific gene from an organism represented in a mixed DNA sample, you can use primer-blast (in the link above) against the nucleotide you wish to make primers from and then you will need to perform in silico tests (e.g. in blastn) against the organisms/genomes you wish not to target using your new primer sets as a query, to make sure your primers are specific enough.
For gene expression, you will need to take mRNA transcripts that span multiple exon boundaries to exclude DNA (if you're using a total RNA-cDNA sample). You can do this on Genbank. There is excellent advice provided in most technical manuals. But here's a helpful link: https://bitesizebio.com/10041/designing-qpcr-primers/