You take it in for an assessment—
In or out of warranty you can get a free over the counter 'Apple Service Diagnostics' test /assessment
Make an appointment for a "hardware issue"—
https://www.apple.com/retail/geniusbar/
Outside the USA
https://locate.apple.com/country
If you have AppleCare+ it will cover a large portion of accidental damage.
https://www.apple.com/support/products/mac.html
AppleCare+ (similar for iPhone and iPad, each incident of accidental damage) for Mac will carry its own price tag. Screen damage or “external enclosure damage” will run $99 per incident, while other damage, including water damage, will run $299. Users receive coverage of two incidents under AppleCare+, and after the two incidents have been used up, out-of-warratny replacement rates will apply.
https://support.apple.com/mac/repair/service