I imagine the drive is at address 8
so to format a disk its
OPEN15,8,15 to open a file to device 8
then
PRINT #15,"N0:DISKNAME" which basically sends to the channel 15 opened above, the text in the quotes which means N(ew drive)0 then the name of the disk
You need to read this manual
http://cini.classiccmp.org/pdf/Commodore/CBM 2040-3040-4040-8050 Disk Drive Manual.pdf
It seems more complicated because the disk operating system is inside the disk drive and you basically send text commands across the GPIB interface and the disk gets on with the job.