The simplest way to derive which beats are stressed in a given time signature is to look at how the notes are beamed or agogically accented.
For example, 6/8 is typically divided in a 3+3/8 grouping (as noted in other answers), however, it could also be grouped 2+4/8, 1+5/8, 4+2/8, and 5+1/8 for example. Each of these different divisions stresses a different beat in the measure, and must be grouped accordingly. Through notation, you can distinguish groupings through how notes are beamed.
This grouping tactic is even more pronounced in asymmetric meters, like 5/8 and 7/8. In these groupings the stresses must become lop-sided, so a 5/8 typically turns into a 2+3/8 or a 3+2/8.
If the time signature doesn't allow for beamed groupings (such as 7/4), then it is important to look at phrasing, and if possible, agogic accents. If in 7/4 I saw two half-notes followed by three quarter-notes, I would know that it had a 4+3/7 grouping.
Alternatively, look at phrase or slur markings to help you distinguish which beats begin / end phrases. Look at other instruments (if available) in the score to see if another part can clarify the confusing grouping. Listen to other recordings and see how others have phrased it. Lastly, play through it and figure out which phrasing sounds good to you.