Simple question, but the answers quickly get complicated because there are so many variables. Different types of microphones with different pickup patterns. Different mic placements based on these different types and on different playing styles. Different rooms and recording technology.
Here is a short article that addresses
some of the issues.
https://recordingmag.com/resources/recording-info/mics-miking/recording-the-flute/ But this overview also makes assumptions.
If you read the article, keep in mind that as a beginner you are likely to use a cardioid dynamic or condenser mic. Not ribbon. Dynamic mics are generally less sensitive and, therefore, pick up less background noise. You tend to see them in live settings. Condenser mics give more detail but tend to pick up the clock across the room or outside traffic. They are more common in studio work. I usually don't bother with condensers unless I have a treated or very quiet room.