A function declares parameters, visibility, optional mutability and return types.
`external` functions can only be called from outside (or via `this.f()`); `public` works both ways; `internal` is callable by this contract and inheritors; `private` only inside this contract.
function stake(uint256 amount) external { }
function _credit(address user, uint256 amount) internal { }
function rate() public view returns (uint256) { return 5; }Prefer `external` for the user-facing surface and `internal` helpers prefixed with an underscore — it keeps the ABI small and the intent obvious.