Baking maps in Blender
About
If you wish to bake material IDs, or any other type of baking (similar to what Substance Painter does) I recommend my favorite Blender plugin: BakeMaster.
If you wish to bake just material IDs without a plugin, that guide is below as well.
Textools was my previous favorite but for now it only works up through Blender 3.2 although some contributors have forked the project to make it work with newer versions.
Requirements
For SU students, BakeMaster can be downloaded here.
Most of these baking tools make use of Blender's Cycles engine (not EEVEE).
Tutorials
Bakemaster introduction
Baking just the ID map (no plugin)