Is DBCC SHRINKFILE better than DBCC SHRINKDATABASE? In the documentation to DBCC SHRINKDATABASE, Microsoft is warning to run the command because it's i/o expensive.
However, in the documentation to DBCC SHRINKFILE, there is no such warning.
Now when we use simple recovery and basically have only one database file, is it better to run DBCC SHRINKFILE or DBCC SHRINKDATABASE?
A database can (and is) composed of multiple files. So shrinking the database would shrink all the files it's composed of, whereas shrinking a file is more granular (as Tibor pointed out). Therefore shrinking a database will always be at least as heavy or heavier of an operation than shrinking just a specific file of the database.
That being said, it's generally recommended against to shrink either because they're both heavy operations, generally nonsensical to do because if they grew to a certain size they'll likely grow back to that size soon anyway and a growth operation is also heavy.