How to create a unique probability density function?

I'm recently learning about PDF and very new to statistics.

I came up with the PDF, f(x) = 3x^2 for 0<x<1 and want to simulate 1000 obs from the pdf and plot a relative histogram of data with the graph of PDF.

However, I'm not sure how to draw observations from the function..

Can anyone help?