@jayanthi the playground is setup in a way to make it easy to get started straight away and see instant results, but if you want to integrate the code into your own local project you’ll need to add extra boilerplate stuff like an html page with a canvas element, then import babylon.js, instantiate the engine & scene and start the render loop.
Try going through the Getting Started documentation here:
Especially Getting Started - Chapter 1 - Setup Your First Web App | Babylon.js Documentation
Also to get up and running quickly if you know how to use npm and typescript, try using one on the starter templates like this:
And there’s some explanatory documentation here: