If it's a client script, the bast way is to to deb...
# suitescript
i
If it's a client script, the bast way is to to debug it in the console.