I'm sure this is a dupe, but I'll go ahead anyway:
LaTeX relates many of its messages to lines in files. For example:
LaTeX Font Info: Try loading font information for OT1+lmtt on input line 81.
But it is often unclear which line of which file is it referring to. Whether it's always a .tex file or possibly a .sty or .cls; whether its the file in its original form, or after it has had some macro expansion; etc. If you try looking for the filename in the lines before the message, you find many filenames, none of which were written by you (e.g.
omslmsy.fd, taken from the same example - which I won't fully list here, since this question is more general).
So is there a simple rule or determining where in the input the message relates to?