There are multiple ways of mining coin like PoW,PoS,Hybrid(PoW + PoS). But the most reliable one till date as in my opinion is PoW. PoW (an protocol/an function) which is used to prevent spam on network by requiring some work from service requester usually meaning processing time of an computer.