This commonly happened use case for any developer.
It is better to have it as function in your local system. (So better to keep this script in one of the shell profile like ksh/zsh or bash profile based on the user preference)
function killport {
kill -9 `lsof -i tcp:"$1" | grep LISTEN | awk '{print $2}'`
}
Usage:
killport port_number
Example:
killport 8080