It depends where you are and the variety of English you are using.
If you are using American English, or among people from the USA or speakers of US English, you shouldn't use the word 'toilet'. This is seen as indelicate. I that situation, I would say, for example, 'I'm just going to the restroom' or 'I'm just going the bathroom'.
In British English, we are less worried about the word 'toilet'. It isn't seen as quite so indelicate to say 'Where are the toilets?', though if you want to be more polite, in a public place, you might say 'Where are the 'ladies'?' or 'Where are the 'gents'?'
In fact, by far the most common word to use in British English is the informal term 'loo'. Among family, friends and colleagues, this is the usual word. If I'm in a meeting at work, whenever anyone needs to leave, they would always say 'loo'. In fact, the most common expression is 'I'm just nipping to the loo' or 'I'm just popping to the loo'. 'Nip' and 'pop' are everyday words to indicate a short trip somewhere.
Another euphemistic term is to take a 'comfort break'. Or, if you're not sure what to say in a formal situation, you could simply say 'Can you excuse me a moment?'