Lets divide the problem is parts, one for the fraction lost, and other for the fraction left.
For the fraction lost, it is said that from 18 marbles, 6 are lost, if we write that as a fraction that is:
6 out of 18 = 6/18
now simplifying it
6/18 = 3/9 = 1/3
so 1/3, one third, or one out of three, is lost.
The fraction left is the subtraction of the initial 18 marbles minus 6, that is 12:
12 out of 18 = 12/18 = 6/9 = 2/3
then the fraction of marbles left is 2/3