If your pattern is indeed one line in the file, then your question is a duplicate of question 5227295:
cat file | sed -n '/_pattern_/q;p'
Notice you may need to escape some characters in _pattern_ in order to make it work as expected (i.e. if your pattern has dots as in ...., you should write \.\.\.\.).
If your pattern may be in the middle of one line, then, in pure Bash:
contents=$(<file)
echo "${contents%%_pattern_*}"
Use ........... (or your pattern) instead of _pattern_. Notice this time you do not need to scape the pattern.