How to hide open ports

how we can hide open ports on internet how to prevent from exploit done if to detect our device is exploited