According the [FIDE LAWS of CHESS][1]:

> 3.9.2 **No piece can be moved that will** either expose the king of the same colour to check or **leave that king in check.**

So as @djnavas points out, if you are in check you have to do at least one of three things to [get out of check][2] (without placing the king in another check) and continue the game:  

- move the king out of check, 
- capture the piece checking you, or
- block the check (by putting one of your pieces in between the king and the piece checking you).


  [1]: https://handbook.fide.com/chapter/E012018
  [2]: https://en.wikipedia.org/wiki/Check_(chess)