I have some flute sheet music that has 2 flutes on the same staff. How to I know which flute plays which part, and furthermore, there are 1s and 2s placed above certain notes in strange places. Do these numbers have anything to do with the 2 parts?
The first player plays the notes written with stems pointing up, the second player the notes with stems down. Usually (but not always) that is the same as "the first player plays the high notes and the second player the low notes."
If only one player plays, for a short passage there should be rests instead of notes written for the other player.
If one player rests for a long time (several bars) the rests may be left out and the first note of the passage is marked 1 or 2 to show who plays it. That instruction continues to apply until another instruction, or there are two notes played simultaneously (i.e. one by each player). Such instructions are often repeated on successive lines of the score, and always repeated at page turns, etc, to avoid any confusion.
Finally, if both players play the same notes, for a short passage, or just one or two notes, this may be shown by single note heads with two stems, one in each direction. For a longer passage the text instructions "a 2" ("For two (players)" in Italian) or "unis." (short for "unisoni" - play in unison).
Here's an example, with the two parts on one staff and written out separately.