Prepare all your ingredients: clean and slice the mushrooms, mince the garlic if using, and measure out your spices and oil.
Heat the oil in a large skillet over medium-high heat until shimmering and slightly fragrant.
Add the cracked black pepper to the hot oil, letting it sizzle for about 30 seconds until fragrant and aromatic.
Gently add the sliced mushrooms into the skillet, spreading them out in a single layer to promote even browning.
Sauté the mushrooms for about 4-5 minutes, stirring occasionally, until they turn golden brown and start releasing their moisture.
If using garlic, add it now and cook for another 30 seconds until fragrant, being careful not to burn it.
Sprinkle salt and chili flakes over the mushrooms, stirring well to combine and allowing the flavors to meld for 2 more minutes.
Turn off the heat, then squeeze fresh lemon juice over the mushrooms if using, and toss to coat evenly.
Transfer the mushroom pepper fry to a serving dish, letting it rest for a minute for the flavors to settle.
Serve hot as a flavorful side or main dish, enjoying the smoky, spicy aroma with each bite.