That is a very good question, because even many Germans get it wrong and are confused by it. But actually it is quite simple and easy to get right. I'll give you two example sentences :
Das Glas, das auf dem Tisch steht ist leer.
Es tut mir leid, dass ich zu spät bin.
If you are able to change the ''das'' or ''dass'' in the sentence with either the words welches, jenes or dieses the ''das'' is the right one to use.
So it could be : Das Glas, welches auf dem Tisch steht ist leer. It is possible to use ''welches'' in the sentence so you know you will use ''das''.
If you are not able to use any of the three words in the sentence instead of the ''dass'' or ''das'' you know its always ''dass''