If that’s coding question - you derive a class from Distribution abstract class and implement some methods of its interface. Just look at source code of some distribution and write yours similarly.
If you ask about .[r]sample(), that has to be implemented manually, normally that is either some transformation of samples from other distributions, or quantile based sampling.
There is also TransformedDistribution that may be useful.